Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 date field

Author  Topic 

cdunn
Starting Member

2 Posts

Posted - 2006-01-11 : 09:55:06
I am using ColdFusion to write to an sql table.
The code is

<cfset dt="#createODBCDate(now())#">

to set todays date. The output for this is

{d '2006-01-11'}

But what inserts into the table is this:

1/11/2006.

SQL was reinstalled recently. The date inserted
correctly before the reinstall. Could this be a
setting during installation.

Thanks for your help.

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2006-01-11 : 10:09:54
Datetime values are stored as numbers, without any formatting. The difference in formatting you see is due to whatever tool you are using to display the data (Enterprise Manager, Query Analyzer, your own code, whatever). Do not be concerned about how the datetime data is stored, and just format whichever way you desire when you display it.
Go to Top of Page

cdunn
Starting Member

2 Posts

Posted - 2006-01-11 : 10:16:48
Using Enterprise Manager. I appreciate knowing this is not a concern and will not affect date management.

THANKS
Go to Top of Page

Frank Kalis
Constraint Violating Yak Guru

413 Posts

Posted - 2006-01-11 : 10:24:56
<shameless plug>
http://www.sql-server-performance.com/fk_datetime.asp
<shameless plug />


--
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
Heute schon gebloggt? http://www.insidesql.de/blogs
Go to Top of Page
   

- Advertisement -