try something like:

<cfset from_date = createDate(form.fromyear, form.fromMonth, 1) />
<cfset to_date = createDate(form.toyear, form.toMonth,
daysInMonth(createDate(form.toyear, form.toMonth, 1))) />

SELECT *
FROM table
WHERE date BETWEEN (#createODBCDate(variables.from_date))# AND
#createODBCDate(variables.to_date)#)

btw...i'm hoping 'date' isn't actually your column name.  it's a
reserved word and will cause you pain and heartache :)

On Thu, 17 Feb 2005 11:19:29 -0500, Mickael <[EMAIL PROTECTED]> wrote:
> Hi All,
> 
> I am a little stumped with the following task in SQL which seems simple 
> enough to me.  I have a form that my users can select a range of Dates for a 
> particular report.  The range is not day month year, but month and year and 
> ending month and year.
> 
> In my database I have a date field, it is only one date.  The date is 
> (dd/mm/yyyy) format.  Let's say that I have
> 5 records for Jan 5, 5 records for Feb 1 and 5 records for feb 15.
> 
> I would like to capture those 15 records by saying
> 
> select * from table where date between Jan2005 and feb2005 ( so in essence
> not having to say Jan 1, 2005 and Feb 28, 2005)
> 
> Can this be done?
> 
> Thanks
> 
> Mike
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:195190
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to