Can you help me with my sql query problem, For example the day today is 2016/12/12 and the expiration date is today(2016/12/12). I want that if the expiration date of promo is today, the promo are still available, then at the next day the promo will not be available or expired already.
here's my query but something wrong because if the expiration date is today the promo is already not available, what i want is if the expiration date of promo is today the promo still available, and by the other day that's the time that the promo will not be available. im sorry my english is not that good! Thanks in advance
ALTER procedure [dbo].[promodate]
as
begin
UPDATE
tblpromo
SET
Status = 0
WHERE
Status = 1
AND
EndDate < GETDATE()
end
Thank you! so i will replace the EndDate < GETDATE() to
SELECT DATEADD(Day, DATEDIFF(Day, 0, GetDate()), 0) AS [LastNight],
DATEADD(Day, DATEDIFF(Day, 0, GetDate())+1, 0) AS [Tonight]???