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 |
|
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2012-03-20 : 00:58:57
|
| how can i enforce user to insert date only in "yyyy-mm-dd hh:mm:ss" format.I understand that i can convert date anytime in any format using "CONVERT" function. But i like user to enter date in this format. ORHow can i check if the format of entered date in database is correct or not. I like to use some function which check dates.Thanks in Advance------------------------------------------------The answer is always no till than you don't ask. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2012-03-20 : 01:47:18
|
| You can easily do this in the front end applicationMadhivananFailing to plan is Planning to fail |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-03-20 : 15:24:12
|
quote: Originally posted by ashishashish how can i enforce user to insert date only in "yyyy-mm-dd hh:mm:ss" format.I understand that i can convert date anytime in any format using "CONVERT" function. But i like user to enter date in this format. ORHow can i check if the format of entered date in database is correct or not. I like to use some function which check dates.Thanks in Advance------------------------------------------------The answer is always no till than you don't ask.
why do need to do this?so far as datatype is datetime and you're passing the values in unambiguos format like YYYYMMDD it shouldnt cause any issues. while retrieving you can change it to any format you want using dateformatting functions------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|