473,394 Members | 1,663 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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..............
Aug 18 '08 #1
2 1636
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
Aug 18 '08 #2
mo/-/sin (Ri*******@gmail.com) writes:
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, es****@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

Aug 18 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Neil | last post by:
Hi, If I have the code line "DateTime d1 = DateTime.Now;" and look at d1 in the watch window, I thought I'd only see the properties of the DateTime object variable d1. However I seem to be...
3
by: nbohana | last post by:
I am using C#, Windows forms and SQL Server. Part of the data that I am having problems with is defined as datetime. When I insert the field into the datebase it is formated as "MM/dd/yyyy", and...
0
by: RSH | last post by:
I am having a bit of trouble filling a datatable with a query. I'm getting the error message: System.FormatException: String was not recognized as a valid DateTime. at...
3
by: Henry Lee | last post by:
hi , all In ASP2.0 , the date object always showing like "3/27/2006 12:00:00 AM" How to remove "12:00:00 AM" and only make it shows "3/27/2006" ? Thanks very much Henry
6
by: JFieseler | last post by:
Hi all, in a huge project i have the following problem. I create an object which contains many private members (i know that this is not correct, but it is a single use migration program). The...
5
by: iulian.ilea | last post by:
Is correct to have a varchar field and insert dates of type dd/mm/yyyy into it? I choose this method because I have an application that runs on more than one server. So, if I used a datetime field...
13
by: lithoman | last post by:
I'm stumped here. I run the procedure Batch_Select against the database with @ID=18 and I get the expected data. When it loads into a SqlDataReader, it gets messed up somehow. Initially, after the...
3
by: reelrave | last post by:
Hello All, I've checked around a little on Google (and this group) and have found info similar to what I'm trying to do (i.e., changes that were made in the BE's tables are not reflected in the...
1
by: gandhi.vishal | last post by:
Hello, I have an issue. I'm not seeing the reportviewer data at all. The column names come up fine but there is no data in the report table. Here is what I'm doing I created a dataset with the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.