GETDATE()

To use the GETDATE() in a database table for intraday table, a sample SQL query would look like:

SELECT *

FROM database_table

WHERE date = GETDATE()

  • Assume there’s a database column with today’s date, and if we run this query every day, it will only return that individual day’s data. This is very useful if you run reports everyday that needs intraday data, for example at the end of the day to send off in reports. See the next lesson for nuances with the GETDATE() function.