Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 18th, 2008, 10:55 AM
mo/-/sin
Guest
 
Posts: n/a
Default not showing proper datetime in tables

i made a table in sql server 2005 and there is column name
dateofjoining... but whenever i insert a value in this column it shows
some other value........
suppose i insert 2005-09-25 but it shows 1905-05-26.... why it is
happening..............
  #2  
Old August 18th, 2008, 01:25 PM
Philipp Post
Guest
 
Posts: n/a
Default Re: not showing proper datetime in tables

There is not sufficient information given to expect a proper reply.
Please post DDL and the query you are executing.

If the data comes from the front end, it might be that there is a
conflict with the language settings.

Some posters advised in this group that the british english version of
SQL Server has problems with the ISO date format, and needs a format
like YYYYMMDD e.g.: 20050925.

brgds

Philipp Post
  #3  
Old August 18th, 2008, 10:35 PM
Erland Sommarskog
Guest
 
Posts: n/a
Default Re: not showing proper datetime in tables

mo/-/sin (Ri.mohsin@gmail.com) writes:
Quote:
i made a table in sql server 2005 and there is column name
dateofjoining... but whenever i insert a value in this column it shows
some other value........
suppose i insert 2005-09-25 but it shows 1905-05-26.... why it is
happening..............
Sounds like you forgot to put 2005-09-25 in quotes, in which case
it becomes a numeric expression with the value 1961. 1961 is then its
turn interpreted as the number of days since the base date which is
1900-01-01 (and which is day 1).
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles