select * from abc where transaction_date = DATE ;

If query started at 11:45 pm and runs for 30 min , after 12 am which date records will be filtered out by query ?

2 Answers

M. Kanarkowski On

If by DATE you meant i.e. GETDATE() only one day will be returned. It's computed when a query starts.

Martin Smith On

There is no function called date.

The built in functions like getdate() are evaluated at the beginning of the execution and treated as runtime constants.

If you wrap them in a scalar UDF they will then be reevaluated for each row though so will then be dependant on time the row is processed.