Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Select only if date in row has not passed yet

I’m selecting rows that have a ‘Date’ column. The date is formatted like so: 2022-01-08 14:00:00.

So today is: 2022-01-05 11:00, I wish to select every row that has a date beyond today’s date.

Is there any way that I can select the rows where the date has not yet passed?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

EDIT:
Ergest Basha’s comment was just what I was looking for:

Date <= current_timestamp()

>Solution :

You can use:

select * from table_name where date >= now()
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading