Skip to content

Latest commit

 

History

History
13 lines (8 loc) · 462 Bytes

getting_previous_day.md

File metadata and controls

13 lines (8 loc) · 462 Bytes

Getting previous day

Just a simple snippet on getting previous days in Presto

DATE(day) = CURRENT_DATE - INTERVAL '1' day

For this snippet depending on how the data type is assigned, in our tables we have day as a varchar therefore for this to work I have to cast day

As per the docs on Date and Time function operators

date(x) → date is an alias for CAST(x AS date)