I had a query in Microsoft Access that used the following WHERE clause to determine the rows in which to sum up.
WHERE BillingDate BETWEEN #1/1/2003# and #1/31/2003#
I am looking to recreate the same functionality in a SQL Server 2000 Stored Procedure and would like to make the stored procedure automatically set the appropriate date range according to the current date.
I forsee using the GETDATE() function to get the current date and then I would like to have the stored procedure set the Start Date to the first of the month and the End Date to the last day of the month for the date returned by GETDATE().
Has anybody tried to do this before? I haven't been able to find any way to round dates using T-SQL. Any thoughts? Thanks for your help.
Nickela
WHERE BillingDate BETWEEN #1/1/2003# and #1/31/2003#
I am looking to recreate the same functionality in a SQL Server 2000 Stored Procedure and would like to make the stored procedure automatically set the appropriate date range according to the current date.
I forsee using the GETDATE() function to get the current date and then I would like to have the stored procedure set the Start Date to the first of the month and the End Date to the last day of the month for the date returned by GETDATE().
Has anybody tried to do this before? I haven't been able to find any way to round dates using T-SQL. Any thoughts? Thanks for your help.
Nickela