Are you sure you copiued & pasted statement #1 correctly as that is invalid...
Anyway - I wouldn't bother making them a single statement in Access. In other RDBSs yes but in Access I would create the two stored queries and then join them in a third stored query. Are you comfortable joining tables\ stored queries?
First works with no problem in my database.
What makes you think it is wrong? - just curiosity...
You are right it is very easy to join them in a stored query but then my only problem is that date in first query. It is a variable in my ASP code, I don't know how I can assign a value for that variable then?
That's what I see as an SQL query in third stored query:
SELECT CertNo, CertDate, CarNo
WHERE (((CertDate)=#4/30/2007#) AND ((CarNo)="8022"));
well... that's what MS Access Query Builder created by itself and as I said before that part of the query works perfectly...
My apologies cuneyt. It really should not work - this is now the second example of Access\ JET allowing (what would normally be considered to be) invalid syntax in aggregate queries that I have seen on this board.
Anyway - using a variable against a stored query is no different to using a variable against a table. They are logically the same. Do you know how to do this against a table? If so - just apply it to the stored query.