hi all
i have a problem.
i would like to retrieve data from MSSQL 2000 database. when i use 1 month calendar, my codes work fine..
sqladapter.SelectCommand = New OdbcCommand("SELECT * from " & table & " where datepart(MM,DATE) = " & Label6.Text & " AND datepart(d,DATE) = " & Label5.Text & " AND datepart(yyyy,date)=" & Label7.Text & " ", conn)
where label6,7,8.text are my dates extracted from the month calendar..
i would like to haf a date range with 2 month calendar..
how should i go about it?? i use the same way to do but there is no data retrieve out..
sqladapter.SelectCommand = New OdbcCommand("SELECT * from " & table & " where DATE between '"datepart(MM,DATE) = " & Label6.Text & " AND datepart(d,DATE) = " & Label5.Text & " AND datepart(yyyy,date)=" & Label7.Text & "' AND "datepart(MM,DATE) = " & Label8.Text & " AND datepart(d,DATE) = " & Label9Text & " AND datepart(yyyy,date)=" & Label10.Text & "' ", conn)
thnx!!
i have a problem.
i would like to retrieve data from MSSQL 2000 database. when i use 1 month calendar, my codes work fine..
sqladapter.SelectCommand = New OdbcCommand("SELECT * from " & table & " where datepart(MM,DATE) = " & Label6.Text & " AND datepart(d,DATE) = " & Label5.Text & " AND datepart(yyyy,date)=" & Label7.Text & " ", conn)
where label6,7,8.text are my dates extracted from the month calendar..
i would like to haf a date range with 2 month calendar..
how should i go about it?? i use the same way to do but there is no data retrieve out..
sqladapter.SelectCommand = New OdbcCommand("SELECT * from " & table & " where DATE between '"datepart(MM,DATE) = " & Label6.Text & " AND datepart(d,DATE) = " & Label5.Text & " AND datepart(yyyy,date)=" & Label7.Text & "' AND "datepart(MM,DATE) = " & Label8.Text & " AND datepart(d,DATE) = " & Label9Text & " AND datepart(yyyy,date)=" & Label10.Text & "' ", conn)
thnx!!