Home > Enterprise >  Select only if date in row has not passed yet
Select only if date in row has not passed yet

Time:01-06

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?

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

Date <= current_timestamp()

CodePudding user response:

You can use:

select * from table_name where date >= now()
  •  Tags:  
  • Related