Phil solution should work, It's worth while always using the local system dateformat (LSDateFormat) to ensure that the days and months don't get mixed up. Of course the Local Settings should be set correctly in the Administrator.

 

The main reason the format did not work is that the date string was not quoted to denote that it was a string as it expects either a string to evaluate or a date type variable.

 

<cfset start_date = createODBCDate(LSDateFormat('15/04/1997','dd/mmm/yyyy'))>

<cfset end_date = createODBCDate(LSDateFormat('15/04/2004','dd/mmm/yyyy'))>

<cfdump var="#start_date#">

<cfdump var="#end_date#">

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Phil Evans
Sent:
Saturday, 8 May 2004 1:37 PM
To: CFAussie Mailing List
Subject: [cfaussie] Re: why wont this date function work?

 

Try the following:

 

1. get a toupee

 

2. untested - but should work

 

<cfset start_date ='15/04/1997'>

<cfset end_date = '15/04/2004'>

 

<cfquery name="testben" datasource="mydsn">
 SELECT *
 FROM bentester 
WHERE bentester.EndDate

    Between #createODBCDate(Start_Date)#

          And #createODBCDate(End_Date)#
</cfquery>

 

HTH

 

Phil.

 

----- Original Message -----

From: "Jamie Lawrence Jenner" <[EMAIL PROTECTED]>

To: "CFAussie Mailing List" <[EMAIL PROTECTED]>

Sent: Saturday, May 08, 2004 1:36 AM

Subject: [cfaussie] why wont this date function work?

 

> Hi
>
> hi
>
> i have no hair! why wont this work!
>
> The date in the db is 18/05/2001 and im using access.
>
> <cfset start_date =DateFormat(createODBCDate(15/04/1997),'dd/mm/yyyy')>
> <cfset end_date = DateFormat(createODBCDate(15/04/2004),'dd/mm/yyyy')>
>
> <cfquery name="testben" datasource="mydsn
> SELECT *
> FROM bentester
> WHERE Format(bentester.EndDate,'dd/mm/yyyy') Between #Start_Date# And
> #End_Date#
> </cfquery>
>
> <cfoutput>
> #bentester.enddate#
> </foutput>
>
> ---
> You are currently subscribed to cfaussie as:
[EMAIL PROTECTED]
> To unsubscribe send a blank email to [EMAIL PROTECTED]
>
> MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
>
http://www.mxdu.com/ + 24-25 February, 2004
>
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

This message may contain privileged or confidential information and is intended only for the individual named. If you are not the named addressee you should not disclose, disseminate, distribute or copy this e-mail. If you have received this e-mail by mistake please notify the sender immediately by e-mail and delete this e-mail from your system. You should rely on your own virus checking programmes and procedures for checking any attachments. Please advise us if you wish your name and e-mail address to be removed from our database.


Reply via email to