> I'm experimenting with a migration from ODBC to OLEDB --> access 2000
>
> This query works fine with an ODBC datasource:
> (STORYDT is a datetime field)
>
> <CFQUERY NAME="getnews" Datasource="#application.mydsn#">
> SELECT SREF, STORYSUBJ, STORYDT
> FROM news
> WHERE (STORYDT > #createodbcdatetime(dateadd("d",-7,now()))#)
> </CFQUERY>

OK, not surprisingly ODBC dates don't work in OLEDB, but do in ODBC

What you have to do is find a "native" version of the date that works in
that database

One format that works in Access 2000 probably won't work in SQL Server

Try;
SELECT fields
FROM table
WHERE dateField > ###DateFormat(DateValue,"d mmm yyyy")#
#TimeFormat(DateValue,"HH:mm:ss")###

I know Access 97 and 2000 are quite happy when you specify a date within #
characters, while SQL Server wants them in apostrophies

Give that a bash and see if it works...

Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to