- see footer for list info -<
Allan,

Use datePart, and group by datepart(year), datepart(month), datepart(day)

that should do what you want... check the sql docs for an exact explanation of what I just said.

Cheers,
Tom

Allan Cliff wrote:
- see footer for list info -<

I want to group a table by date.
The date column is a date/time column but I want to group on a per day
basis.
i.e.
<CFQUERY NAME="GetRequests2" DATASOURCE="#request.maindsn#">
 SELECT day(R.RequestDate) as rd, Count(R.RequestID) AS Total
 FROM Requests R
WHERE R.RequestDate BETWEEN #attributes.fromdate# AND
#attributes.todate#
 GROUP BY day(R.RequestDate)
</CFQUERY>
This works fine but when the date span is over a month then the 1st June
is obvioulsy treated as 1 as is the first of any month
I want to group by the date irrespective of the time.
Hope you get it.
Allan
_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-

- Hosting provided by www.cfmxhosting.co.uk -<
- Forum provided by www.fusetalk.com -<
- DHTML Menus provided by www.APYCOM.com -<
- Lists hosted by www.Gradwell.com -<
- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<




        
        
                
___________________________________________________________ Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com
_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
- Hosting provided by www.cfmxhosting.co.uk -<
- Forum provided by www.fusetalk.com -<
- DHTML Menus provided by www.APYCOM.com -<
- Lists hosted by www.Gradwell.com -<
- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to