3
I am in need of help with dates in SQL Server.
I have a date field and would like to know if this date is odd or even. Because I need to make this comparison to use in another field. I looked for some methods but I did not reach the solution. I thought about using DATEDIFF but I don’t have another date field to compare.
CASE WHEN DATEPART(DW, CONVERT(DATE,data_saida)) IN (3) AND porto = 409
THEN CONVERT(VARCHAR(15),DATEADD(DAY, -2, CONVERT(DATE,data_saida))) + ' TO ' + CONVERT(VARCHAR(15),DATEADD(DAY, -1, CONVERT(DATE, data_saida)))
This code I use that this delivery is only on Tuesday. I’m not taking into consideration whether data_output is odd or even. Now came this last-minute demand and I don’t know where to fit properly.
Can describe what an "even date is"?
– Woss
30 of any month/year is an even date? the validation would only be on the day of the month??
– rLinhares
Excuse the lack of information. I wonder if on the full date (DD/MM/YYYY) the DD is even or odd. For example today 14/12/2018 (14 > even). These dates I have are within the current month.
– BRKZ