how to select date range?
My provider --> Provider=VFPOLEDB.1
im using datetimepicker to pick date.
The problem is when i select date range it cannot read my query. But if i just select like this :
v_str = "Select * from attend where [DATE] = '" & v_dtpDateFrom.ToString("MM/dd/yyyy")"
its not appear any data.
v_str = "Select * from attend where [DATE] >= '" & v_dtpDateFrom.ToString("MM/dd/yyyy")"
its appear data but its also appear unwanted data(Mean: if i select date from '02/11/2011', it will show all the record even the record not according my date selected )
this my code:
My date range code:
Dim v_dtpDateFrom, v_dtpDateTo As Date
v_dtpDateFrom = New Date(dtpDateFrom.Value.Year, dtpDateFrom.Value.Month, dtpDateFrom.Value.Day)
v_dtpDateTo = New Date(dtpToDate.Value.Year, dtpToDate.Value.Month, dtpToDate.Value.Day)
v_str = "Select * from attend where [DATE] >= '" & v_dtpDateFrom.ToString("MM/dd/yyyy") & "' AND DATE < '" & v_dtpDateTo.ToString("MM/dd/yyyy") & "'"