I’m hitting the DB for a 100 records from a MySQL DB that have a DateAdded (timestamp) column.
I’d like to find a SMART way to display the records as follows in Coldfusion, w/o hitting the database multiple times.
Today:
– records…..
Yesterday:
– records…..
Earlier This Week:
– records…..
Earlier This Month:
– records…..
Older:
– records…..
Thanks for the ideas on how to get this done smartly in ColdFusion.
Query of Queries? – http://livedocs.adobe.com/coldfusion/8/htmldocs/using_recordsets_3.html#1157970
You may want to use the
BETWEENSQL operator. See: http://livedocs.adobe.com/coldfusion/8/htmldocs/using_recordsets_7.htmlYou may also use
<cfqueryparam>tag. See: http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_p-q_18.html#1102474Query of Queries might not be the most efficient, but in my opinion it is the cleanest way to represent your intent and it just works.