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 |
rajnidas
Yak Posting Veteran
97 Posts |
Posted - 2015-02-03 : 06:36:48
|
MY CODE IS NOT RUNNING.IT SHOULD PRINT '1900-01-01' BCOZ TEST TABLE IS BLANK.DECLARE @CHKDT1 AS DATESELECT @CHKDT1 = MAX(CONVERT(DATE,COMPUTEDATE,121)) FROM testIF (@CHKDT1 = '' OR @CHKDT1 = NULL)BEGIN SET @CHKDT1 = CONVERT(DATE,'1900-01-01',121)ENDprint @CHKDT1THANKS,RAJNI |
|
sz1
Aged Yak Warrior
555 Posts |
Posted - 2015-02-03 : 06:51:33
|
DECLARE @CHKDT1 AS DATESET @CHKDT1 = (SELECT MAX(CONVERT(DATE,COMPUTEDATE,121)) FROM test)IF (@CHKDT1 = '' OR @CHKDT1 IS NULL)BEGINSET @CHKDT1 = CONVERT(DATE,'1900-01-01',121)ENDprint @CHKDT1We are the creators of our own reality! |
|
|
rajnidas
Yak Posting Veteran
97 Posts |
Posted - 2015-02-03 : 07:14:37
|
THANKS ITS WORKING THANKS RAJNI |
|
|
sz1
Aged Yak Warrior
555 Posts |
Posted - 2015-02-03 : 07:16:13
|
Good stuff.We are the creators of our own reality! |
|
|
|
|
|