FoxProProgrammer
Programmer
PHV helped me combine three queries into a single query yesterday. His suggestion worked great, but when I viewed the SQL in the Query Designer today, I noticed that Access had modified the syntax.
Original SQL:
SQL after closing and reopening the Design window. Note the changes in Bold print:
The really weird thing is that the SQL will run when I first open the Query Builder (even though the SQL has a syntax error), but if I change anything and put it back exactly as before, Access gives me a bracketing error. For example, I inserted an extra space between the first SELECT and "X", then deleted the space, and Access returns the error. I can get rid of the error by editing the SQL to change the [ to ( and deleting the . at the end of each subquery. Does anyone know what is causing this? It is a problem because the user would get this error if they ever open the query and make a change to it, and may not know how to correct it.
Thanks,
dz
dzaccess@yahoo.com
Original SQL:
Code:
SELECT X.*, Y.*, O.*
FROM (SELECT fldlist FROM tblname WHERE somefld = "X") As X
, (SELECT fldlist FROM tblname WHERE somefld = "Y") As Y
, (SELECT otherflds FROM tblname) As O
;
SQL after closing and reopening the Design window. Note the changes in Bold print:
Code:
SELECT X.*, Y.*, O.*
FROM [b][[/b]SELECT fldlist FROM tblname WHERE somefld = "X"[b]].[/b] As X
, [b][[/b]SELECT fldlist FROM tblname WHERE somefld = "Y"[b]].[/b] As Y
, [b][[/b]SELECT otherflds FROM tblname[b]].[/b] As O
;
The really weird thing is that the SQL will run when I first open the Query Builder (even though the SQL has a syntax error), but if I change anything and put it back exactly as before, Access gives me a bracketing error. For example, I inserted an extra space between the first SELECT and "X", then deleted the space, and Access returns the error. I can get rid of the error by editing the SQL to change the [ to ( and deleting the . at the end of each subquery. Does anyone know what is causing this? It is a problem because the user would get this error if they ever open the query and make a change to it, and may not know how to correct it.
Thanks,
dz
dzaccess@yahoo.com