Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

187
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!