How to create a condition that does not include the month of December?

Asked

Viewed 80 times

3

I am creating a condition to be executed before the month of December, IE, only runs in the period of january to november year-independent.

IF (SELECT TarFechamento FROM Tarefa WHERE TarID = @Tarefa) < '01-12-2017'

I put it like it was the year of 2017, but want regardless of the year 2018,2019,2020, etc

  • only use Month... if Month([date]) <12... https://msdn.microsoft.com/pt-br/library/ms187813(v=sql.120). aspx

2 answers

4


The query you need to make is this, using the Month() to know only the month of the date

SELECT * FROM Tarefa WHERE TarID = @Tarefa and month(TarFechamento) <> 12
  • 1

    ball show @rLinhares, Brigadeo. Ah. Help me on that other question, rsrs

  • can’t get you in chat.. I’ll try to see it again here, please..

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.