This is a follow-up from a previous post I made.  Thanks to Pascal for helping me earlier!

Here's what my table looks like:

ConfHrsFrom     ConfHrsTo
12:00            2:00
4:30             6:30

While there isn't a column of data per se, I'm doing a DATEDIFF on the From and To fields to determine the total hours used.  From there, all I want to is SUM the value of DATEDIFF for each row of data (psuedo column SUM).  Hope this makes sense.  Here's my latest piece of code:

<CFQUERY NAME="sumtest" DATASOURCE="esitest">
SELECT tblclientdailies.ClientName, acctstatus, dailiesdate, postagesentto, noofcopies, postagesite,
confhrsused, confhrsfrom, confhrsto, confroom, postagecost, misc, miscdesc, faxin, faxout,
SUM(DATEDIFF(minute, confhrsfrom, confhrsto)) AS total_no_of_minute

FROM  tblclientdailies, tblclients
where tblclients.clientname = tblclientdailies.clientname
and   tblclients.acctstatus = 'A'
and dailiesdate BETWEEN #Date1# AND #Date2#
and tblclientdailies.clientname like '%marsh%'

GROUP BY tblclientdailies.ClientName, acctstatus, dailiesdate, postagesentto, noofcopies, postagesite,confhrsused,
confhrsfrom, confhrsto, confroom, postagecost, misc, miscdesc, faxin, faxout

order by dailiesdate

</CFQUERY>

Thanks!
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to