Since the first day of every year is January 1 (I think, I hope), you should
be able to just use dateadd() to get your date range based on the two
day-of-year values you specify (ie. 525 - 4). If the second value is less
than the first, you know to add 365 to it in your addition. You can get the
current year using year(now()).

Does that work?

Adam.



> -----Original Message-----
> From: Sean Daniels [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 05, 2002 10:06 AM
> To: CF-Talk
> Subject: Seasonal Content
> 
> 
> I want to have some seasonal content in an app I am building. 
> The content
> will reside in a db and I want to query for it based on 
> today's date. I am
> clear on how I could do this for a single year: simply put 
> fields to search
> on for start and end dates and look for records where 
> getdate() between
> start_date and end_date. However, next year these dates would 
> be invalid.
> 
> I'm sure there is some slick way to do this computation based 
> on the current
> day of the year (1-365), but I'm not sure of how exactly to 
> store the valid
> range. I could have content valid from day 27 through day 189 
> of the same
> year. Or, I could have content valid from day 325 through day 4 of the
> following year. So a simple "between start_day and end_day" 
> won't do the
> trick.
> 
> Thanks in advance.
> 
> - Sean
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~
> Sean Daniels
>   Director, Engineering
>   Marketplace Technologies, Inc
>     (T): 207.363.7374
>     (C): 207.332.6340
>     (F): 240.269.6319
> ~~~~~~~~~~~~~~~~~~~~~~~~~~
>   http://www.dealforce.com
>   http://www.mergernetwork.com
> 
> 
> 
______________________________________________________________________
Get Your Own Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb
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

Reply via email to