the Jet db engine accepts # as date delim (as opposed to SQLServer using
' )

either triple up your ### (escape chars) or use <cfqueryparam...

cheers
barry.b



-----Original Message-----
From: Scott Thornton [mailto:[EMAIL PROTECTED] 
Sent: Friday, 28 May 2004 10:53 AM
To: CFAussie Mailing List
Subject: [cfaussie] MS Access Query Problem with Date

Hi,

The query:

SELECT 
message_type, 
attach, 
attachment, 
date_time 
FROM messages 
WHERE 
message_type = 'SWAP' AND 
attach = 'Y'  AND 
date_time < #CreateODBCDate(dateadd('d',-7, now()) )#

generates the following error:

Error Executing Database Query.  
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC
Microsoft
Access Driver] Too few parameters. Expected 1.


the debugging shows the sql as:

SELECT message_type, attach, attachment, date_time FROM messages WHERE
message_type = 'SWAP' AND attach = 'Y' AND {d '2004-05-21'}

which is formed well.

As I don't use MS Access often (preferable NEVER), I don't know how to
troubleshoot this. I have tried a few thingsd to no avail.

The problem line is 

date_time < #CreateODBCDate(dateadd('d',-7, now()) )#

when I remove it, the query works.

The Database is MS Access.

Any thoughts?

Thanks,

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

Reply via email to