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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How can I change structure of the Date
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

grandhi
Starting Member

31 Posts

Posted - 05/07/2013 :  01:54:48  Show Profile  Reply with Quote
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

Malaysia
982 Posts

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

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 05/07/2013 :  03:51:23  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000