G
Guest
Hi there,
Firstly, I hope this is in the right place!
I have a problem with a nested query I am generating at runtime.
My table (tblIndexValue) has values in every cell in all rows including the
createdUserID column. The createdUserID's datatype is a GUID, and the table
is in Access using Jet 4 to connect from .NET.
Here is the query, as captured in the immediate window: -
SELECT DocumentID,
(SELECT value FROM tblIndexValue WHERE
indexFieldID={7b47a555-9a8e-4336-acbf-12b170d46f71} AND
departmentID={f7d75dd6-096c-43e1-9f25-285fbe74a547} AND
DocumentID=Q.DocumentID) AS IV1,
(SELECT createdUserID FROM tblIndexValue WHERE
indexFieldID={7b47a555-9a8e-4336-acbf-12b170d46f71} AND
departmentID={f7d75dd6-096c-43e1-9f25-285fbe74a547} AND
DocumentID=Q.DocumentID) AS IVID1
FROM tblDocument AS Q
GROUP BY Q.DocumentID;
IV1, i.e. the value field (a text value) displays fine. However, IVID1, the
createdUserID file (a GUID) only shows NULLS. If I run the inner query on
it's own (i.e. SELECT createdUserID FROM .... substituting the Q.DocumentID
for any of my documentID GUIDs) it displays as expected.
Have I missed something here?
Many thanks,
David
Firstly, I hope this is in the right place!
I have a problem with a nested query I am generating at runtime.
My table (tblIndexValue) has values in every cell in all rows including the
createdUserID column. The createdUserID's datatype is a GUID, and the table
is in Access using Jet 4 to connect from .NET.
Here is the query, as captured in the immediate window: -
SELECT DocumentID,
(SELECT value FROM tblIndexValue WHERE
indexFieldID={7b47a555-9a8e-4336-acbf-12b170d46f71} AND
departmentID={f7d75dd6-096c-43e1-9f25-285fbe74a547} AND
DocumentID=Q.DocumentID) AS IV1,
(SELECT createdUserID FROM tblIndexValue WHERE
indexFieldID={7b47a555-9a8e-4336-acbf-12b170d46f71} AND
departmentID={f7d75dd6-096c-43e1-9f25-285fbe74a547} AND
DocumentID=Q.DocumentID) AS IVID1
FROM tblDocument AS Q
GROUP BY Q.DocumentID;
IV1, i.e. the value field (a text value) displays fine. However, IVID1, the
createdUserID file (a GUID) only shows NULLS. If I run the inner query on
it's own (i.e. SELECT createdUserID FROM .... substituting the Q.DocumentID
for any of my documentID GUIDs) it displays as expected.
Have I missed something here?
Many thanks,
David