Using the code hereunder, I query my database (from MS Access VBA code). Some of my queries give empty results, which isn't like by my program.
For example:
This gives as an error:
For as far as I can tell, this has to do with empty results. As these queries sometimes give empty results, I really need to do something about this. Thing is.. what, and how?
Thanks in advance!
For example:
Code:
R5SQLC1 = "SELECT COUNT(*) FROM Planning AS D1, Planning AS D2 WHERE D1.werknemer=" & TheWorker & " AND D2.werknemer=" & TheWorker & " AND (D1.AanvangsTijd <= D1.Stoptijd) AND (DateDiff('d', D1, D2) = 1) AND (((D2.AanvangsTijd + 24) - D1.Stoptijd) < 44) AND D1.Datum < D2.Datum" Debug.Print R5SQLC1 Set C1 = Db.OpenRecordset(R5SQLC1, dbOpenDynaset)
Run-time error '3601':
Too few parameters, expected 2
Too few parameters, expected 2
Thanks in advance!
Comment