Automatic Date/Time in a SQL Server Query
Posted on 2004-10-01
I have a query that selects data from one table and inserts it into another one. Part of the query looks for data in a date range. (Between '9/29/2004 0:1:00' And '9/29/2004 23:59:59')
How can I programatically via VB or Stored Procedure generate the time format for a given time period , say the previous day, and insert it into the query? I will run this query at 1 AM on the next day. For example want to pull data from the 29th so I run it on the 30th.
Any help is appreciated.