|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
getting records by date
I've got some code that is driving me nuts.
strSQL="SELECT comments6 FROM modissurvey WHERE datevalue >= " & strStartDate &"AND datevalue <= " & strStopDate This is not working as it returns 0 records when it shouldn't. My strStartDate is in the form 2/1/2004. The datevalue field in the table is in the form 2/1/2004. I cannot figure out why this sql is not working. Can anyone shed some light? |
|
#2
|
||||
|
||||
|
What database?
|
|
#3
|
|||
|
|||
|
I would start by returning all datevalues. Make sure it is in the correct format. Also, I don't know if you copied your code exactly as it appears in your work, but the [ "AND ] may need a space that is causing your SQL to kludge (Probably not that). . .
The way we are accessing our DB we have to include a timestamp as well as a datestamp, perhaps try adding 00:00:01 to the end of your date field? |
|
#4
|
|||
|
|||
|
Back to Memnoch question, Which Database.
Different Db use different Syntax for Date, yours is probably incorrect. S- |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > getting records by date |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|