sorry, had to actually work  ^_^

Why use CreateODBC date at all?  I never use it myself.  


this is incorrect
<cfset formatted_date1 = dateformat(startdate(), "MM-DD-YYYY")>
   <cfset formatted_date2 = dateformat(enddate(), "MM-DD-YYYY")>

startdate() is not a function.  should be


<cfset formatted_date1 = dateformat(startdate, "MM-DD-YYYY")>
   <cfset formatted_date2 = dateformat(enddate, "MM-DD-YYYY")>

Now, is startdate and enddate input from the user?


Doug

-----Original Message-----
From: Ian Vaughan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 15, 2004 9:22 AM
To: CF-Talk
Subject: RE: CF Dates with MX 6.1 ?

Archive: http://www.houseoffusion.com/lists.cfm/link=i:4:166648
---
Just these letting me down

<cfset formatted_date1 = dateformat(createodbcdate(startdate),
"MM-DD-YYYY")>
   <cfset formatted_date2 = dateformat(createodbcdate(enddate),
"MM-DD-YYYY")>

I have tried

   <cfset formatted_date1 = dateformat(startdate(), "MM-DD-YYYY")>
   <cfset formatted_date2 = dateformat(enddate(), "MM-DD-YYYY")>

but am recieving

Entity has incorrect type for being called as a function.

The symbol you have provided startdate is not the name of a function.

________________________________

From: Pascal Peters [mailto:[EMAIL PROTECTED]
Sent: 15 June 2004 11:23
To: CF-Talk
Subject: RE: CF Dates with MX 6.1 ?

Archive: http://www.houseoffusion.com/lists.cfm/link=i:4:166621
---
> Pascal
>  
> This is the original code, and you are correct its in US Format
>  
> <cfset formatted_date = dateformat(Now(), "mm/dd/YYYY")>
>  
> WHERE startdate <= #createodbcdate(formatted_date)#
>  
> So change it to ....
>  
> WHERE STARTDATE <= TO_DATE(<cfqueryparam cfsqltype="cf_sql_varchar"
> value="#formatted_date#">,'DD/MM/YYYY')
>  
> Is this correct ???

No, the mask has to match  the date format so:
WHERE STARTDATE <= TO_DATE(<cfqueryparam cfsqltype="cf_sql_varchar"
value="#formatted_date#">,'MM/DD/YYYY')

> would I have to change the following line
>  
> <cfset formatted_date = dateformat(Now(), "mm/dd/YYYY")> ???
>

You don't have to, but you could do
<cfset formatted_date = dateformat(Now(), "yyyy-mm-dd")>
....
WHERE STARTDATE <= TO_DATE(<cfqueryparam cfsqltype="cf_sql_varchar"
value="#formatted_date#">,'YYYY-MM-DD')

You can pretty much do what you want as long as the mask in TO_DATE
matches the date format!

Pascal
________________________________
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to