I have a conundrum that's driving me crazy and frustrating my client too.
  We have an application where dates are being stored in our database in
strange ways.

If the day is less than or equal to the 12th of the month,   the date is
stored as yyyy-dd-mm  but if the day is after the 12th of the month, it's
stored as yyyy-mm-dd. (the latter is what we want)    I dont understand why
the program shouldnt be consistent - always store the date the same way
around regardless of whether the day is 12 or less or not.

For example if the date is 7th May,  I can see using CFDUMP that all
throughout the coldfusion app, the beans and other processing it's held as
07/05/2010.   But if it's saved into the SQLServer2005 database, it's stored
as 2010-07-05 00:00:00.    However if the date is 23 May,   the beans etc
show it as 23/05/2010  but it's saved in the database as 2010-05-23
00:00:00

The database field is defined as smalldatetime.    The insert statement for
the record inserts the value ECRTTotal.getdateentered()  as follows:

 #createodbcdate(ECRTTotal.getdateentered())#

I've also used <cfqueryparam value="#ECRTTotal.getdateentered()#"
cfsqltype="CF_SQL_TIMESTAMP" /> and that gives the same result.   (the
variable ECRTTotal.getdateentered() is definitely a date object being
created by createdate() function.

There is a huge amount of existing code that works ok except for this issue,
 so i need to be careful about changing anything that might break bits of
the app that are already working.

Anyone have any ideas where i should look for the cause/solution?

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

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

Reply via email to