I suspect you are not giving the db a date in an unambiguous format from CF,
ie {ts '2010-05-12 15:45:00}
You can sometimes give a date in 'native' format to a db and it will accept
it, but it is essentially ambiguous ie 1/5/2010 - is this 1 may or 5th Jan?
The createodbcDate() or createodbcdatetime() functions are your friend.
Richard
> -----Original Message-----
> From: Mike Kear [mailto:[email protected]]
> Sent: 12 May 2010 15:10
> To: cf-talk
> Subject: Re: SQLServer2005 and European dates
>
>
> Thank you Steve, but I dont think you've seen the point. The query you
> wrote isnt the one I'm using.
>
> you wrote:
> Select *
> From someTable
> Where myDate >= '05-01-2010'
> And myDate < dateAdd(m, 1, '05-01-2010');
>
> and that gets all the May results.
>
> We're sending:
> Select *
> From someTable
> Where myDate >= '01-05-2010'
> And myDate < '31-05-2010';
>
> and it gets NO May results.
>
> As i said, re-writing hundreds of queries throughout the application is
> NOT
> an option.
>
> Cheers
> Mike Kear
> Windsor, NSW, Australia
> Adobe Certified Advanced ColdFusion Developer
> AFP Webworks
> http://afpwebworks.com
> ColdFusion 9 Enterprise, PHP, ASP, ASP.NET hosting from AUD$15/month
>
>
> On Wed, May 12, 2010 at 11:42 PM, DURETTE, STEVEN J (ATTASIAIT) <
> [email protected]> wrote:
>
> >
> > Ok, so I made a mistake in my code...
> >
> > Here is the correction:
> >
> > Select *
> > From someTable
> > Where myDate >= '05-01-2010'
> > And myDate < dateAdd(m, 1, '05-01-2010');
> >
> > That code gets everything greater than or equal to 2010-05-01
> > 00:00:00.000 and less than 2010-06-01 00:00:00.000
> >
> > Steve
> >
> >
> >
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333605
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm