I have a datagrid that displays results of some metrics from a SQL Server 2000 database grouped by Date. When a user first enters the site, there are two textfields for entry of two dates: date1 and date2. And as you guessed it, the results are shown between these two dates.
I would like create a similar report that displays all of the data (sums) for the current month. How can I do this? I have tried, but can't seem to get it correctly.
Here is my original SQL SELECT statement:
Dim queryString As String = "SELECT Convert(char(10),DataDate,101) as [Date], SUM([Data1]), SUM([Data2]), SUM([Data3]" & _
"FROM [tblData] WHERE ([DataDate] BETWEEN @Search AND @Search2) GROUP BY [DataDate]"
Is there someway to select per DataDate.Now.Month or so?
I would like create a similar report that displays all of the data (sums) for the current month. How can I do this? I have tried, but can't seem to get it correctly.
Here is my original SQL SELECT statement:
Dim queryString As String = "SELECT Convert(char(10),DataDate,101) as [Date], SUM([Data1]), SUM([Data2]), SUM([Data3]" & _
"FROM [tblData] WHERE ([DataDate] BETWEEN @Search AND @Search2) GROUP BY [DataDate]"
Is there someway to select per DataDate.Now.Month or so?