I have a query in SQL server 2005 that I run every day. Can I change the values below to pull the date from the system rather than having to change them each day?
set @rundate = '2006-04-21' -- Today
set @startdate = '2006-04-20 12:00:00' --Yesterday 12 PM
set @enddate = '2006-04-20 12:00:00' --Today 12 PM
The Start and End dates have to use 12:00 PM
Can I use the GetDate function to set this up??
Please help as this is urgent.