문제

I have created the StackOverflow OData query Find unanswered questions by non-noob.

It works fine so far, except that I want to limit the questions to questions asked in the last N days (e.g. 7 days).

I have tried

datetime'##Since##T00:00:00'

and I have read posts like OData Date query, but none of them is specifying the date in a relative way to today.

How can I complete my query to select new questions only?

도움이 되었습니까?

해결책

I found the solution for your problem over here so I added the following lines:

DECLARE @today Datetime = getdate()
DECLARE @NrDays int = ##NrDays:int?7##

...

and datediff(Day,CreationDate,@today) <= @NrDays

So this is my solution: Find unanswered questions by non-noob within last week

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top