Hi,

Query is the same as your suggestion now (minus CreateODBCDate  )

Same error message.

The DSN has been set up via Coldfusion Adminsitrator..... I have
deleted it and re-added it just to be certain it is ... normal..... 

>>> [EMAIL PROTECTED] 28/05/2004 2:07:12 pm >>>
try this

<cfquery ...>
        SELECT message_type, [attach], [attachment], date_time 
        FROM messages 
        WHERE message_type = 'SWAP' AND 
                attach = 'Y'  AND 
                date_time < <cfqueryparam cfsqltype="cf_sql_date"
                value="#dateadd('d',-7, now())#">
</cfquery>

unless I'm mistaken, cfqueryparam will take care of the odbc date
format
for you. 

... unless your DSN is using something other than the MSAccess/Jet
driver (as specified in CF admin DSN's)....

cheers
barry.b







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

Hi,

Would you imagine that the following code would work?

SELECT 
message_type, 
[attach], 
[attachment], 
date_time 
FROM messages 
WHERE 
message_type = 'SWAP' AND 
attach = 'Y'  AND 
date_time < <cfqueryparam cfsqltype="cf_sql_date"
value="#CreateODBCDate(dateadd('d',-7, now()) )#">

it doesn't. the error is:

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


Wow, it expects two parameters now......

Scott Thornton, Programmer
Application Development
Information Services and Telecommunications
Hunter Area Health Service
Phone  +61 2 49214193
Fax       +61 2 49214191

[EMAIL PROTECTED] 

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

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