SELECT @couponID=id,@value=value, @percent=[percent]
FROM T_Order_Coupon
WHERE (active = 1) and siteid=@siteid and coupon=@coupon AND (expdate<=GETDATE() or expdate is null)
------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/