sql Parameters working with Dates
Hello: I have an sql query and am trying to use parameters and it looks like this:
sql="Select * from tblTable where DateCreated Between ? and ?''
When I run it, it passes through with no errors; however, it doesn't get any data so thinking I must not be doing something correctly due to the Between statement and using dates.
Thanks,
Proctor
Re: sql Parameters working with Dates
There is no inherent problem with dates and parameters, so presumably you are doing something wrong.
The possibilities include not passing in dates (but strings that get converted to dates, which often goes wrong), putting the values in the wrong order, the field being text based rather than date based, and more.
If you give us more details (such as the data type of the field, the code you use to add parameters, etc) we can hopefully work it out.