Complicate math problem :D

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Locked
nackgr
Forum Newbie
Posts: 11
Joined: Mon Feb 21, 2011 3:22 am

Complicate math problem :D

Post by nackgr »

Hallo

I have a table with 9 colums

serial | cli | cld | connect_time | metric | chargetime | charge |destination |de_charge


I want for each serial to chargetime /60 and * with de_charge

For each serial for all serials and if is able to can add between dates
IF someone can help me i will gratefull
Thanks very much
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Re: Complicate math problem :D

Post by Apollo »

I want for each serial to chargetime /60 and * with de_charge

For each serial for all serials and if is able to can add between dates
What? Image
nackgr
Forum Newbie
Posts: 11
Joined: Mon Feb 21, 2011 3:22 am

Re: Complicate math problem :D

Post by nackgr »

hahah sorry :D

I upload a demo of the file it inside a mysql table

I want for each serial somehow take chargetime division with 60 and propagation with de_charge number

Thanks :D
Attachments
cdr.zip
(18.85 KiB) Downloaded 342 times
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Re: Complicate math problem :D

Post by Apollo »

So, what's the problem with (chargetime/60)*de_charge ?
nackgr
Forum Newbie
Posts: 11
Joined: Mon Feb 21, 2011 3:22 am

Re: Complicate math problem :D

Post by nackgr »

SELECT serial
, chargetime / 60 * de_charge AS result
FROM daTable

I forgot to mention the problem is how can i make it work between dates i have a colum with dates too
nackgr
Forum Newbie
Posts: 11
Joined: Mon Feb 21, 2011 3:22 am

Re: Complicate math problem :D

Post by nackgr »

SELECT serial
, chargetime / 60 * de_charge AS result
FROM daTable
where connect_time between 'date' and 'date
Locked