kev510
Programmer
- Jul 12, 2006
- 61
Hello everyone.
I am having some trouble with my .asp page.
The web page is designed to let the user select one date (LETS USE 1/1/2007), and it'll search for all data that were created on that date. The problem is that simply running the string below -
select * from TABLE where CreatedDate = '" & vSearchDate & "'
It will show only the data that were created on 1/1/2007 00:00:00.
I also tried
select * from TABLE where CreatedDate between '" & vSearchDate & "' and '" & vSearchDate & " 23:59:59'
and
select * from TABLE where CreatedDate between '" & vSearchDate & "' and DATEADD(day, 1, '" & vSearchDate & "')
but those strings will also show data that were created on 1/2/2007.
I need my page to show every data that were created on 1/1/2007 regardless of the TIME recorded in the data table.
Any suggestions are appreciated. Thank you so much!
I am having some trouble with my .asp page.
The web page is designed to let the user select one date (LETS USE 1/1/2007), and it'll search for all data that were created on that date. The problem is that simply running the string below -
select * from TABLE where CreatedDate = '" & vSearchDate & "'
It will show only the data that were created on 1/1/2007 00:00:00.
I also tried
select * from TABLE where CreatedDate between '" & vSearchDate & "' and '" & vSearchDate & " 23:59:59'
and
select * from TABLE where CreatedDate between '" & vSearchDate & "' and DATEADD(day, 1, '" & vSearchDate & "')
but those strings will also show data that were created on 1/2/2007.
I need my page to show every data that were created on 1/1/2007 regardless of the TIME recorded in the data table.
Any suggestions are appreciated. Thank you so much!