Hi all,
Can someone please help with a easy one here. Thanks.
The Below Query Returns : 123456 | 01/04/2020 for example.
__________________________________________
SELECT
ID, CONVERT(VARCHAR,E.[Start Date],103) AS [Start Date]
FROM
EVENTS AS E
____________________________________
[Days From Start Date], [Weeks From Start Date],
CASE [Week From Start Date]
WHEN [Week From Start Date] >=0 THEN 'Yes - Started'
WHEN [Week From Start Date] >=-1 THEN 'Within 1 Week'
WHEN [Week From Start Date] > = -2 THEN 'Within 2 Weeks'
WHEN [Week From Start Date] >= -4 THEN 'Within 4 Weeks'
ELSE 'Outside 4 weeks '
END
FROM Events AS E
your case statement will probably look something like this:
CASE
WHEN DATEDIFF(week,E.[Start Date], GETDATE()) >=0 THEN 'Yes - Started'
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy