---
> 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]

