Jim Watkins wrote:
> Jochem helped me convert the to_date function to work in MS Access and now I have a problem with to_char.  When I run the script against an Access DB I get:  Undefined function 'to_char' in _expression_.
>
> For Oracle SQL=My script is:
> <cfquery name="leavehistory" datasource="banner">
> SELECT fromdate1
> FROM leaverequest
> WHERE (('#UCase(DateFormat(dailydate, "DD-mmm-YYYY"))#' like to_char(fromdate1, 'DD-MON-YYYY')))
> </cfquery>
>
> Would someone help me get the above statement acceptable to MS Access?

Stop formatting dates as strings. Use cfqueryparam and pass it a
date object:

<cfquery name="leavehistory" datasource="banner">
SELECT fromdate1
FROM leaverequest
WHERE <cfqueryparam cfsqltype="cf_sql_date" value="#dailydate#">
= fromdate1
</cfquery>

Jochem

--
I don't get it
immigrants don't work
and steal our jobs
     - Loesje
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to