2
I need to know how to get inside a select (with LEFT JOIN
, INNER JOIN
) take the day of the week from a field of a table, compare and see which day of the week, if it is 1 add 2, if it is 7 add 1?
Example:
case when datepart (weekday, campo.da.tabela) = 1 then campo.tabela+2 when (datepart (weekday, campo.da.tabela) = 7 then campo.tabela+ 1
but that way it’s not working, I don’t know how to ride.
In SQL SERVER.
Hello @Rafael. Your question is unclear. Can you elaborate further? The field
campo.tabela
is whole? The week starts on Sunday or Monday?– João Martins
Welcome to Stackoverflow in English. I edited your question to remove the greetings as we usually keep the text as clean as possible to focus on your scheduling question. If you are interested in visiting a part of the site that is not aimed to ask questions can know the [chat]. If you have questions about the operation, rules and procedures of the site visit the [meta] :)
– Sorack