Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

188
Visualizações
Extract dates from where clause between two dates

I have an array of dates and I need to find if the user had an active membership during those dates.

['2016-04-17', '2016-04-18', '2016-04-22', '2016-04-23']

Sometimes a membership can't be charged and go inactive for a few days until the next payment is processed, or the user may cancel and reactivate later.

The way I'm solving this is having a transactions table with a paid_at column and expires_at (expiring date set after 1 month of paid).

I would need to perform a where clause to return me the dates that match between those two columns in all the records in the database. I don't need the record itself, just returning the date means should be enough to know it was a day while the membership was active.

Im having a hard time understanding how such a query could be made. Any suggestion?

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda