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 |
|
snufse
Constraint Violating Yak Guru
469 Posts |
Posted - 2008-07-16 : 16:39:40
|
How do I test on date value passed as parm (whether it is empy or blank)?CREATE PROCEDURE sp_ProductionInquiry @JobNumber int,@DateFrom datetime,IF @DateFrom = 0 BEGIN SELECT job_date ......... ENDELSE BEGIN SELECT job_date ..... |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-07-16 : 16:48:34
|
Since it is declared as DATETIME it always has a datetime value.The only other value possible is NULL.IF @DateFrom IS NULL BEGIN SELECT job_date ......... ENDELSE BEGIN SELECT job_date ..... WHERE SomeDateColumn >= @DateFrom E 12°55'05.25"N 56°04'39.16" |
 |
|
|
snufse
Constraint Violating Yak Guru
469 Posts |
Posted - 2008-07-16 : 19:02:51
|
| Peso, as always, thank you ... |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-17 : 00:07:26
|
| and IF ELSE can be written asSELECT job_date .....WHERE (SomeDateColumn >= @DateFromOR @DateFrom IS NULL) |
 |
|
|
|
|
|