'Get records for past month, day and a specific 24 hour period in the past
At the moment I have:
SELECT timeslot_start_time
, name
, description
, etc
FROM Table1
WHERE Timeslot_start_time >= '2022-02-01'
ORDER BY Timeslot_start_time
Q1. Instead of doing this manually, is there a way the table only gets data that is a month old from today automatically?
Q2. Additionally, my data is in this format: 22-02-15 21:45:00, with data reading every 15 minutes. Is there a way I can create a column(/table or whatever is best) that filters only the last 24hours automatically?
Q3. Additionally, is it possible to filter the last 24hrs but from a specific time. For example filtering the last 24hrs up to 10pm, So 10pm-10pm.
I hope all of that makes sense
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
