|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
THIS WORKS...
'''''''''''''''''''''''''''''''''''''''''''''''''' '''' sqltext = "Select * from People " sqltext = sqltext & "WHERE PeopleDOB between " sqltext = sqltext & "#" & varDOBStart sqltext = sqltext & "# AND #" & varDOBEnd & "#;" '''''''''''''''''''''''''''''''''''''''''''''''''' '''' THIS DOES NOT....(assume string is ALL ON ONE LINE) sqltext = "Select * from People WHERE PeopleDOB between #" & varDOBStart "# AND #" & varDOBEnd & "#;" Since I am learning I really dont have a clue as to why. I T-H-I-N-K it has something to do with the formatting of the date info. But I CANNOT figure it out. Even though the code above works, I dont understand WHY it works...i think thats rather danger...can someone explain please? |
|
#2
|
|||
|
|||
|
Well, for one thing you're missing an ampersand after varDOBStart in the second example...
|
|
#3
|
||||
|
||||
|
If you ever think you have something wrong with a string - do a reposnse.write on it - you'll quickly see what the problem is.
Response.write() is your friend! |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft SQL Server > Question on : #" & varDOBStart "# AND #" & varDOBEnd & "#;" |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|