Add an interval to a date until is today sql server query -
i need query table rows date field + amount of 7 day intervals today, date in past , can number of days in past.
for example if today 2014-06-27 , have table below:
table ------------------ id | date ------------------ 1 | 2014-06-13 ------------------ 2 | 2014-06-14 ------------------ 3 | 2014-05-30 ------------------
the rows 1
, 3
should returned, row 2
shouldn't because 2014-06-14 + 2 x 7 day intervals = 2014-06-28
after today.
try
select * datediff(dd,date,getdate())% 7 = 0
Comments
Post a Comment