I am continually getting a Syntax error on the following SQL statement in Access VBA. Best I can guess is that it is occurring perhaps because there is no IN( ) statement usage in jet SQL, which I assume is what is really used when I use DoCmd.RunSQL in Access VBA.
Here is the current code:
It checks out fine when I parse it in MS SQL Server Mgmnt Studio just to check, but in Access VBA, it constantly gives a Syntax error. Also, if I put it into an Access Query, I get a Syntax Error.
I thought I'd attempt to create it via an Access Query in order to see where I was going wrong, and the only difference I noticed right away was that the IN() Function was not available in the query expression builder.
Am I on the right track, or is some other teensy weensy typical syntax error sneaking in that I just cannot seem to track down?
Thanks in advance for any help!
--
"If to err is human, then I must be some kind of human!" -Me
Here is the current code:
Code:
DELETE [tblAll].[*]
FROM [tblAll]
WHERE
(([tblALL].[Case Number] IN (
SELECT [tblHist_Data].[Case Number]
FROM [tblHist_Data]
))
AND ([tblALL].[Date] IN (SELECT [tblHist_Data].[Date])));
It checks out fine when I parse it in MS SQL Server Mgmnt Studio just to check, but in Access VBA, it constantly gives a Syntax error. Also, if I put it into an Access Query, I get a Syntax Error.
I thought I'd attempt to create it via an Access Query in order to see where I was going wrong, and the only difference I noticed right away was that the IN() Function was not available in the query expression builder.
Am I on the right track, or is some other teensy weensy typical syntax error sneaking in that I just cannot seem to track down?
Thanks in advance for any help!
--
"If to err is human, then I must be some kind of human!" -Me