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

SQL Add One Day To Query Date

I would like to add one day to query date, then get all the data greater than today.

Fields:
valid_to

Table:
Post

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

Select * from posts where valid_to + 1 > Now()

>Solution :

The Postgres SQL you want here is:

SELECT * FROM posts WHERE valid_to + interval '1' day > NOW();

As for the logic, it is not clear this is the query you need without seeing some sample data.

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