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 |
|
shifis
Posting Yak Master
157 Posts |
Posted - 2009-02-20 : 14:51:17
|
| HiI have to validate a day that could be in the next formats, to see if is right:d/m/yyyydd/m/yyyyd/mm/yyyydd/mm/yyyyHow can I do that?Thanks |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Nageswar9
Aged Yak Warrior
600 Posts |
Posted - 2009-02-20 : 23:35:23
|
| See this link i would be helpfule for uhttp://www.sql-server-helper.com/tips/date-formats.aspx |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-02-21 : 01:38:25
|
quote: Originally posted by shifis HiI have to validate a day that could be in the next formats, to see if is right:d/m/yyyydd/m/yyyyd/mm/yyyydd/mm/yyyyHow can I do that?Thanks
1 Always use proper DATETIME datatype2 Express the dates in universal format YYYYMMDD HH:MM:SS3 To see if they are valid dates, assuming you express them in dmy formatSET dateformat dmyselect isdate(ypur_date)MadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-02-21 : 01:50:00
|
quote: Originally posted by shifis HiI have to validate a day that could be in the next formats, to see if is right:d/m/yyyydd/m/yyyyd/mm/yyyydd/mm/yyyyHow can I do that?Thanks
isdate(col)=1and len(col)>8 |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-02-21 : 02:06:33
|
quote: Originally posted by visakh16
quote: Originally posted by shifis HiI have to validate a day that could be in the next formats, to see if is right:d/m/yyyydd/m/yyyyd/mm/yyyydd/mm/yyyyHow can I do that?Thanks
isdate(col)=1and len(col)>8
Wont work without SET dateformat dmy MadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-02-21 : 02:23:54
|
quote: Originally posted by madhivanan
quote: Originally posted by visakh16
quote: Originally posted by shifis HiI have to validate a day that could be in the next formats, to see if is right:d/m/yyyydd/m/yyyyd/mm/yyyydd/mm/yyyyHow can I do that?Thanks
isdate(col)=1and len(col)>8
Wont work without SET dateformat dmy MadhivananFailing to plan is Planning to fail
yup thats true |
 |
|
|
|
|
|