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.
Author |
Topic |
sunny_10
Yak Posting Veteran
72 Posts |
Posted - 2013-03-07 : 05:42:04
|
Hi I have datetime field . Regional Settings is MM/dd/yyyy. In which format date will be stored in DatabaseThanks |
|
rjhe22
Constraint Violating Yak Guru
283 Posts |
Posted - 2013-03-07 : 05:53:57
|
probably yyyy/mm/dd all mine do |
|
|
sunny_10
Yak Posting Veteran
72 Posts |
Posted - 2013-03-07 : 06:07:07
|
Hi When i insert record i gave written this Format(DTPicker3.Value, "MM/dd/yyyy") . On what basis date is stored in Database.Thanks |
|
|
MIK_2008
Master Smack Fu Yak Hacker
1054 Posts |
Posted - 2013-03-07 : 06:16:55
|
In which database are you going to store? .. If SQL server then check the default format by executing SELECT getdate()You'll find the format in which SQL server stored date datatype value in a field.CheersMIK |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-03-07 : 06:22:05
|
quote: Originally posted by sunny_10 Hi When i insert record i gave written this Format(DTPicker3.Value, "MM/dd/yyyy") . On what basis date is stored in Database.Thanks
dates are stored in sql server internally as integer values. when you select datetime field the values will be shown in iso format yyyy-mm-dd hh:mi:ssYou can apply CONVERT() function to get it in format you want by making it varchar and specifying a style value which corresponds to format. This can also be done in front end applications using format functions available there.See below links for more infohttp://visakhm.blogspot.in/2012/07/generate-datetime-values-from-integers.htmlhttp://visakhm.blogspot.in/2011/12/why-iso-format-is-recommended-while.htmlhttp://msdn.microsoft.com/en-IN/library/ms187928.aspx------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|