I would recommend convert your date/time in your table in Date format only.
For example, if you are using MS SQL server, you can do that like:
****************************************************************************
SELECT convert(varchar(10), articledate, 101) as articledate
FROM yourtable
etc......
ORDER BY articledate
***************************************************************************
That will convert your "2009-05-12 20:16:44" to '05/12/2009'
Then you can use GROUP attribute in your OUTPUT:
***************************************************************************
<cfoutput query="articles" group="articledate">
#DateFormat(articledate, 'mmmm dd, yyyy')#
<cfoutput>
***************************************************************************
Regards,
Misha
-----Original Message-----
From: Barry Mcconaghey [mailto:[email protected]]
Sent: Sunday, August 23, 2009 10:10 PM
To: cf-newbie
Subject: Grouping Data By Date
Hello.
How do I group data by date when the date format in my table is a date and
time format.
(2009-05-12 20:16:44).
I would like to sort or list all the articles for each day. But it is not
working because the time is different for each article but the dates are the
same.
<cfoutput query="articles" group="articledate">
#DateFormat(articledate, 'mmmm dd, yyyy')#
<ul>
<cfoutput>
<li>
#articleTitle#
</li>
</cfoutput>
</ul>
</cfoutput>
Thanks!
Barry
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4754
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15