David,
I asked such a question a while back. Answer follows.
My query was:
select month (compdate) as month, day (compdate) as day, year
(compdate) as year, net_sales
from sale_head
where locnum = #Form.StoreNum#
AND compdate >= today - 365
order by month, day
Paul
-----Original Message-----
From: Justin Greene [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 9:13 AM
To: CF-Talk
Subject: RE: What is best way to write this report?
Write your query to return:
Month (as number), Day (as number), other data
order by Day, Month
Then loop through the result and each time the month is < the last
month
start a new row.
Justin
-----Original Message-----
From: David Grabbe [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 12:31 PM
To: CF-Talk
Subject: Data-modeling for anniversaries...
I've run into a data-modeling stumper. I have a database table which
contains wedding anniversaries and the respective couple's name. The date
is stored as the wedding date, so calculating the anniversary is easy. The
primary usage of this is to display the anniversaries on a monthly calendar.
However, now i need to select just the anniversaries which will be coming up
in the next week. The problem is that since the dates are stored with the
original years (i.e. 11/28/1970), I can't just select the dates that are
between a specific date range, because the year will throw that all out of
whack. So how can i select based just on the month/day, also taking into
account that in the middle of the "week" the month can change to the next
month (November-December)? Any ideas?
Cheers,
David
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists