RE: SQL Query Statement

2001-12-10 Thread Pascal Peters

WHERE cal_date_start = cfqueryparam cfsqltype=CF_SQL_DATE
value=#CreateODBCDate(Now())#
  AND cal_date_end = cfqueryparam cfsqltype=CF_SQL_DATE
value=#CreateODBCDate(Now())#

This is independent of your DB. You can also use DB  functions to get
the current date

-Original Message-
From: Mark Leder [mailto:[EMAIL PROTECTED]]
Sent: maandag 10 december 2001 6:52
To: CF-Talk
Subject: SQL Query Statement


I have two date fields (cal_date_start and cal_date_end).  The dates are
formatted as mm/dd/.
How would I write a WHERE clause when querying the db to retrieve the
records between the two dates (maybe using the BETWEEN statement)?
It's OK to get records on the actual start date and end date. - So if
today
is 12/09/2001, its OK to retrieve records between 12/07/2001 and
12/16/2001.

In other words:  WHERE DateValue(Now()) BETWEEN cal_date_start AND
cal_date_end.

Thanks,
Mark

~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: SQL Query Statement

2001-12-09 Thread Douglas Brown

Yeah you can do that.

WHERE dateFormat(Now()) BETWEEN '#cal_date#' AND '#cal_date_end#'


Doug



- Original Message -
From: Mark Leder [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Sunday, December 09, 2001 9:51 PM
Subject: SQL Query Statement


 I have two date fields (cal_date_start and cal_date_end).  The dates are
 formatted as mm/dd/.
 How would I write a WHERE clause when querying the db to retrieve the
 records between the two dates (maybe using the BETWEEN statement)?
 It's OK to get records on the actual start date and end date. - So if
today
 is 12/09/2001, its OK to retrieve records between 12/07/2001 and
12/16/2001.

 In other words:  WHERE DateValue(Now()) BETWEEN cal_date_start AND
 cal_date_end.

 Thanks,
 Mark
 
~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists