House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Search cf-talk

July 04, 2009

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Home / Groups / ColdFusion Talk (CF-Talk)

Date Range Without Year

Author:
Barney Boisvert
12/02/2008 02:39 PM

Select all events between February 12th and June 10th: select * from eventTable where dateCol between 212 and 610 cheers, barneyb > That representation makes sense, but there needs to be a way to use it to > construct SELECT queries using >=, <=, or BETWEEN.  Using expressions with > MySQL functions in the SELECT would be ok, if it can be done. > > >> You could just use numbers to represent the dates.  Year runs from 101 >> to 1231 (thats MDD), and easily create from a date like this: >> #month(now()) * 100 + day(now())#.  Strings would also work instead of >> numbers: "0101" to "1231", and created via #dateFormat(now(), >> "mmdd")#. >> >> cheers, >> barneyb >> >> >>> The DBMS that I'm using is MySQL 5.0. >>> >>> I have a table where I want to store begin and end dates _without_ a >>> year. >>> For example, 'Dec 4' through 'Jun 15'.  How can I best represent this >>> in >>> the database? >>> >>> I'll be doing selects of the nature >>> >>> SELECT * >>> FROM mytable >>> WHERE #today# BETWEEN begindate AND enddate >>> >>> >>> >> >> > >


Mailing Lists