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 |
mike13
Posting Yak Master
219 Posts |
Posted - 2013-03-13 : 01:46:37
|
Hi all,i got this statementSELECT @couponID=id,@value=value, @percent=[percent]FROM T_Order_CouponWHERE (active = 1) and siteid=@siteid and coupon=@coupon AND expdate<=GETDATE() But i only want to use the where clause expdate<=GETDATE()if column expdate is not NULLHow do i do that?thanks a lot, |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-03-13 : 01:53:21
|
[code]SELECT @couponID=id,@value=value, @percent=[percent]FROM T_Order_CouponWHERE (active = 1) and siteid=@siteid and coupon=@coupon AND (expdate<=GETDATE() or expdate is null)[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
mike13
Posting Yak Master
219 Posts |
Posted - 2013-03-13 : 05:13:00
|
Thanks a lot! |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-03-13 : 06:41:25
|
welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|