Hum

This works. Thanks, what a pain!  

This immediately makes a migration to OLEDB a waste of time.  (Might
look at it for future apps)

It also makes me think there should be a set of new functions in CF:

createDBdate(mydate,"theDB")
createDBdatetime(mydatetime,"theDB")

Where theDB could be "Access", "SQLServer","ODBC"(!) etc.




> Date: Sat, 10 Mar 2001 20:01:03 -0000
> From: "Philip Arnold - ASP" <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: RE: Dates in OLEDB
> Message-ID: <[EMAIL PROTECTED]>
> 
> > 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.
> **********************************************************************
> 
> 

--
Regards;

Richard Meredith-Hardy
-------------------------------------------------------------
[EMAIL PROTECTED]
Tel: + 44 (0)1462 834776 FAX: + 44 (0)1462 732668

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