> I can't do that (MySQL) - but I can do Maxrows="1" - and I usually do.

For the record, putting maxrows=1 in a cfquery still asks the database
to retrieve all the rows-- the drivers just stop fetching after the
first row.  Your database might be able to optimize fetching the first
record better than that.  For MySQL, use "LIMIT 1" at the end of the
select.

> So - with that in mind - how could I do it? Without storing "future dates"

I know storing a table with future dates in it might seem hard to
manage, but it's not uncommon.  I have seen many companies do it with a
flag to mark holidays since holidays vary from year to year and company
to company.  Generally, you can populate a year's worth of dates with a
very simple script. And yes, you will need to manually decide what your
holidays are-- but there really isn't much of a way around that since
you said yourself they may not be the same every year.  But seriously,
we're talking about 20 minutes of work every year.

Also, tables like this can be very handy for reporting.  You can join
directly to it to eliminate holidays from reports.  Also if you have a
date-range report where you want to return a record for every day in the
range but don't necessarily have data for every day, simply left outer
join your data to this table.

~Brad



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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-talk/message.cfm/messageid:329756
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to