Im trying to pull data from excel spreadsheets using Ole and some sql.
However, there are times when the end user has edited additional rows by accident, or just had the cursor in teh wrong place, and so the query imports all rows up to the position of the last edit. (Sometimes leaving me with blank records)
I have tried
But that seems to exclude rows where any 1 of the above is null. What I need to do is import all rows, unless all 3 of the above fields are null.
(i.e. if fn and dob are present but sn is null, then this is a valid row for importing.)
Any thoughts on how to structure the SQL? (I'd rather do this in the query than loop through all the datarows in my code and delete them there if atall possible.)
Cheers
K
However, there are times when the end user has edited additional rows by accident, or just had the cursor in teh wrong place, and so the query imports all rows up to the position of the last edit. (Sometimes leaving me with blank records)
I have tried
Code:
"SELECT * FROM [Sheet1$]", WHERE (fn IS NOT null and sn is not null and dob is not null)"
But that seems to exclude rows where any 1 of the above is null. What I need to do is import all rows, unless all 3 of the above fields are null.
(i.e. if fn and dob are present but sn is null, then this is a valid row for importing.)
Any thoughts on how to structure the SQL? (I'd rather do this in the query than loop through all the datarows in my code and delete them there if atall possible.)
Cheers
K