Thanks Jochem now and how would I treat the following "between dates":

'#DateFormat(dailydate, "DD-mmm-YYYY")#' between fromdate5 and todate5

I tried <cfqueryparam cfsqltype="cf_sql_date" value="#dailydate#">between fromdate1 and todate1   
but get the following error:

Syntax error (missing operator) in query _expression_ 'approval = 'Y' AND Pa_RaM000between fromdate1 and todate1

Jim Watkins

  ----- Original Message -----
  From: Jochem van Dieten
  To: CF-Talk
  Sent: Monday, January 05, 2004 2:30 AM
  Subject: Re: to_char in MS Access

  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