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
 General SQL Server Forums
 New to SQL Server Programming
 How can I change structure of the Date

Author  Topic 

grandhi
Starting Member

31 Posts

Posted - 2013-05-07 : 01:54:48
Hi All,

In my App,some date based computations are there,so for practice purpose I tried the following example.

I created Table,that corresponding code is in following below.

CREATE TABLE DateFormatTesting(	date Date,Name varchar(100))


I inserted some values into that table,That corresponding code is in below

insert into DateFormatTesting (DateFormatTesting.date,DateFormatTesting.Name) values ('1990-12-21','Subbu')


If you can observe the above query,my Date structure is like YYYY-MM-DD,I evaluated above query,it returns 1 row affected.

again,I try toinsert different structure of the Date ,but it's not working.That corresponding code is in following below.

insert into DateFormatTesting (DateFormatTesting.date,DateFormatTesting.Name) values ('21-12-1990','Subbu')


How can I change Date structure.and also where will I get good documentations for Date with Examples.

waterduck
Aged Yak Warrior

982 Posts

Posted - 2013-05-07 : 02:46:06
http://www.sqlusa.com/bestpractices/datetimeconversion/
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-05-07 : 03:51:23
see
http://visakhm.blogspot.in/2011/12/why-iso-format-is-recommended-while.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -