P
Peter
I have a simple Append query that I use a sub query to determine the value of
one of the fields to be appended. When I attempt to run the query I get an
error, "Reserved Error (-3025); there is no message for this error".
If I remove the sub query and replace it with a literal value the query
works, all fields are text.
INSERT INTO Table1 (Field1, Field2, Field3)
SELECT 'val1' AS [1stfield], 'val2' AS [2ndfield],
(SELECT newvalue FROM Table2 WHERE Table2.testcondition = 'val2') AS
[3rdfield]
The sub query works as a standalone select query without any trouble, note
that Table2.testcondition is the primary key of that table.
If I change it to be 2 queries nested then it works but this is undesirable
since this has to be created and run in code, a sub query is simpler in every
respect, well... if it works that is.
Will Access not allow a sub query in an Append query? I can't say that I've
ever tried to do this before but it never occurred to me that it wouldn't
work and I was surprised when it didn't.
The error message, or lack thereof, doesn't give much away. This is Access
2003 SP3 on Windows XP Pro SP3.
one of the fields to be appended. When I attempt to run the query I get an
error, "Reserved Error (-3025); there is no message for this error".
If I remove the sub query and replace it with a literal value the query
works, all fields are text.
INSERT INTO Table1 (Field1, Field2, Field3)
SELECT 'val1' AS [1stfield], 'val2' AS [2ndfield],
(SELECT newvalue FROM Table2 WHERE Table2.testcondition = 'val2') AS
[3rdfield]
The sub query works as a standalone select query without any trouble, note
that Table2.testcondition is the primary key of that table.
If I change it to be 2 queries nested then it works but this is undesirable
since this has to be created and run in code, a sub query is simpler in every
respect, well... if it works that is.
Will Access not allow a sub query in an Append query? I can't say that I've
ever tried to do this before but it never occurred to me that it wouldn't
work and I was surprised when it didn't.
The error message, or lack thereof, doesn't give much away. This is Access
2003 SP3 on Windows XP Pro SP3.