Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another
- From: "RB Smissaert" <bartsmissaert@xxxxxxxxxxxxxxxx>
- Date: Sat, 27 Oct 2021 20:25:45 +0100
Trying to run a parameterized query with this SQL
UPDATE PATIENT P
SET P.REGISTRATION_START_DATE =
(SELECT MAX(P2.REGISTRATION_START_DATE)
FROM PATIENT P2
WHERE P2.PATIENT_ID IN(?, ?))
WHERE P.PATIENT_ID = ?
And running in VBA like this:
cmdADO.Execute , Array(lNewPID, lOldPID, lNewPID), adExecuteNoRecords
This gives the above error.
When I do this:
UPDATE PATIENT P
SET P.REGISTRATION_START_DATE =
(SELECT MAX(P2.REGISTRATION_START_DATE)
FROM PATIENT P2
WHERE P2.PATIENT_ID IN(?, ?))
WHERE P.PATIENT_ID = " & lNewPID
cmdADO.Execute , Array(lNewPID, lOldPID), adExecuteNoRecords
It all runs fine.
Why is there a problem with the first method?
RBS
.
- Follow-Ups:
- Prev by Date: Write ti XML with C#
- Next by Date: Re: Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another
- Previous by thread: Write ti XML with C#
- Next by thread: Re: Arguments are of the wrong type, are out