Mike,
I find it hard to believe it is SQL Server, this smacks of ColdFusion its the exact type of behaviour that ColdFusion does. Hard to believe that SQL Server would modify an ODBC date due to a localisation setting. I would still try to duplicate the problem with your own code, can you write code that will put it in the database wrong. createODBCDate(createDate(year, month day)) I but you can't make that put a wrong date in unless you get the month and day back to front Regards Dale Fraser http://dale.fraser.id.au http://cfmldocs.com <http://cfmldocs.com/> http://learncf.com http://flexcf.com From: cfaussie@googlegroups.com [mailto:cfaus...@googlegroups.com] On Behalf Of Mike Kear Sent: Tuesday, 8 June 2010 12:47 PM To: cfaussie@googlegroups.com Subject: Re: [cfaussie] Odd date behaviour - CF9/SQLServer2005 @Dale, I would have said that too. My first assumption was that i had an error in my code somewhere. So I did a CFDUMP of the variables that I'm inserting into the table and they show the dates the way I want them. The coldfusion createdate function receives 3 numeric variables that are definitely year, month, day, so I'm pretty sure that's working ok (i.e. createdate(thisyear, thismonth, thisday) ) and if i CFDUMP the resulting date object and output it with dateformat, I see it how i want it - the month is correctly identified there. Then i assumed i must be allowing some ambiguity in the date in my insert statement so I used the ColdFusion debugging to show me the actual query used to insert the record, and it shows the dates correctly too. Specifically, it shows an insert of a date 2010-05-08 that appears subsequently in the database as 2010-08-05 I think your earlier assumption is quite likely - that it's something to do with localisation on the database, rather than the ColdFusion code. Is there a way to set localisation on a database as a kind of database setting rather than in each query? (this is SQLServer2005) 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 Tue, Jun 8, 2010 at 12:36 PM, Dale Fraser <d...@fraser.id.au> wrote: I don't think it is, Write some test code, my money is that you can't duplicate it unless you create the date incorrectly in the first place. Regards Dale Fraser http://dale.fraser.id.au http://cfmldocs.com <http://cfmldocs.com/> http://learncf.com http://flexcf.com -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaus...@googlegroups.com. To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en. -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaus...@googlegroups.com. To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.