|
Mailing Lists
|
Home / Groups / ColdFusion Talk (CF-Talk)
Date Range Without YearSelect 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 >>> >>> >>> >> >> > > |
March 19, 2010
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||