Thanks Gregory,

I had tried that earlier, and kept getting errors - I was trying to add
the DATEPART to the SQL group by as well.. doh!

I ended up with SELECT ... DATEPART(dy,orders.orderdate) AS myDate ...

then using myDate as the group="" param in the query output - works like
a charm..

Thanks!

Jeff



-----Original Message-----
From: Gregory Harris [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 22, 2002 5:23 PM
To: CF-Talk
Subject: RE: Group by on date/time field


In the select statement of your query you can use the SQL Server
DatePart function as I copy and paste from the SQL Server help file, any
questions let me know:

---------Begin Shameless Copying----------

Datepart ()

Returns an integer representing the specified datepart of the specified
date.

Syntax
DATEPART(datepart, date)

Arguments

datepart
Is the parameter that specifies the part of the date to return. The
table lists dateparts and abbreviations recognized by MicrosoftR SQL
ServerT.


Datepart Abbreviations
year yy, yyyy
quarter qq, q
month mm, m
dayofyear dy, y
day dd, d
week wk, ww
weekday dw
hour hh
minute mi, n
second ss, s
millisecond ms


--------------End Shameless Copying-----------------

Gregory Harris
[EMAIL PROTECTED]

-----Original Message-----
From: Jeff Beer [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 22, 2002 1:59 PM
To: CF-Talk
Subject: Group by on date/time field


<cf_BrainFart>

I have a query that needs to be output in groups based on a datetime
value (SQL Server 7.0/2000).

The trouble I'm having is with the time value.  I need to group on the
date alone.

Do I need to store the values seperately, or can SQL parse it in the
query as only the date portion so CF can use it in the <cfoutput
group="">?

</CF_BrainFart>





Jeff Beer
Director of Application Development
Digital Stormfront, Inc
http://www.digitalstormfront.com <http://www.digitalstormfront.com>




______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to