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 |
phong919
Starting Member
29 Posts |
Posted - 2008-04-09 : 10:55:06
|
Hello all,I was wondering if someone can assist me with the following date validation: i'm looking at somebody's sql and not sure what it meansCONVERT (varchar, dbo.tblSS_Milestone.dtBaselineStart, 101)what does 101 mean?Also can someone show me how i can check if there are nulls in the field and if there is, i would like to use another field with a value.I'm not sure how to do that in sql server. Thank you. |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-04-09 : 10:58:38
|
1. 101 denotes a format in which date will be converted in varchar - like mm/dd/yyyy, mm-dd-yyyy etc.2. make use of ISNULL() or COALESCE()Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
|
|
phong919
Starting Member
29 Posts |
Posted - 2008-04-09 : 11:01:28
|
Can you post a sample of how to use? I'm just learning as i go along. thank you for your reply. |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-04-09 : 11:02:59
|
[code]Select IsNull(Null-Column, Non-Null-column)from Table[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
|
|
phong919
Starting Member
29 Posts |
Posted - 2008-04-09 : 11:19:29
|
how would i do that with a case function? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-04-09 : 11:21:47
|
CASE WHEN Null-Column IS NULL THEN Non-Null-column ELSE Null-column END |
|
|
phong919
Starting Member
29 Posts |
Posted - 2008-04-22 : 15:55:34
|
Hello visakh16,How can i also convert the date to the right format within the case statement above. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-04-22 : 16:44:35
|
Read about CAST & CONVERT in Books Online.Every single format is described. E 12°55'05.25"N 56°04'39.16" |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|