Check between date ranges?

Asked

Viewed 94 times

3

Table Ciclos:

inserir a descrição da imagem aqui

I have the date 2018-07-05

How could I ride a query between the intervals of CiDtIni and CiDtFim according to the date above?

  • 3

    select * from Ciclos where dataInformada between CiDtFim AND dataInformada

  • 1

    select * from Ciclos Where dataInformada between ciDtIni and Cidtfim

1 answer

3


I had informed a query in the comments tab that I believe is what you need. Just use the BETWEEN to work with date range.

SELECT *
FROM Ciclos
WHERE dataInformada BETWEEN CiDtIni AND CiDtFim
  • In the comment you posted select * from Ciclos where dataInformada between CiDtFim AND dataInformada, is not wrong? I was trying to understand, and now that you posted different, this yes I understood.

  • @RBZ in the comment was typo!

  • 1

    I got it! Worse is that it has 3 votes the comment. You can see the attention of those who voted! rs

Browser other questions tagged

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