Polariz666
Programmer
Hey guys,
I'm currently writing a program that pulls data out of a database for statistical purposes. The following SQL command is wrong somehow and I can't figure out why.
rs.Open "SELECT Name, S, Time, Tid FROM TstArchive WHERE Time LIKE '" & passDateToQueryField.Text & "*' ", db, adLockOptimistic
It is designed with the following data in mind:
Time: 20000623121426
Tid: 2 or 3 (All data in the database is in String format)
In the text box 'passDateToQueryField.Text' there will be a value of something like '2000062312', and I obviously want to find all records that are like this, ignoring the '1426' part of the example. However at the moment the SQL statement only ever looks for records equal to 2000062312, and hence never finds any records.
Any help really appreciated,
Mike.
I'm currently writing a program that pulls data out of a database for statistical purposes. The following SQL command is wrong somehow and I can't figure out why.
rs.Open "SELECT Name, S, Time, Tid FROM TstArchive WHERE Time LIKE '" & passDateToQueryField.Text & "*' ", db, adLockOptimistic
It is designed with the following data in mind:
Time: 20000623121426
Tid: 2 or 3 (All data in the database is in String format)
In the text box 'passDateToQueryField.Text' there will be a value of something like '2000062312', and I obviously want to find all records that are like this, ignoring the '1426' part of the example. However at the moment the SQL statement only ever looks for records equal to 2000062312, and hence never finds any records.
Any help really appreciated,
Mike.