Hi,
I have daily scheduled task that queries a table which includes column named AttemptDate with datetime as datatype. However the task queries all entries regardless of the date. So when the tasks executes, it outputs entries of all the dates as shown below:
2009-06-06 06:01:30.852
2009-06-07 01:41:46.719
2009-06-08 03:58:23.945
The SQL query is shown below:
SELECT AttemptDate from dbo.ChangeAttempt
The table dbo.ChangeAttempt has the following structure:
Column Data Type Constraints
------ --------- -----------
EventData xml NOT NULL
AttemptDate datetime NOT NULL DEFAULT GETDATE()
DBUser char(50) NOT NULL
My question is: From my existing TSQL query, how do I get entries of the current date part if I add where clause?
What I mean by current date here is the date the TSQL query is scheduled to run.
ADDITION:
The SQL Server version I am running the TSQL query against is 2005.