Isaac
Lifelong Learner
- Local time
- Today, 00:20
- Joined
- Mar 14, 2017
- Messages
- 11,108
I must be really losing it today. Here is my scenario:
SQL for lower level query:
SQL for higher level query:
- In qryID_and_BU_CompleteStatus, if I run that query, the column BU - has NO records where the value is 214
- In the higher-level query (which refers to #1 query), called qryID_and_BU_Completion_1, I am querying from two sources: SharepointIDs_to_BusinessUnits and qryID_and_BU_CompleteStatus, left joined from SharepointIDs_to_BusinessUnits.[BusinessUnitID] to qryID_and_BU_CompleteStatus.[BU]
- In that #2 query, I am returning the column [Complete] from qryID_and_BU_CompleteStatus
- On the record in question, where the SharepointIDs_to_BusinessUnits.[BusinessUnitID] = 214, the [Complete] column is showing a value, rather than Null.
SQL for lower level query:
Code:
SELECT qryID_and_BU.SP_ID, CInt([qryID_and_BU].[BU]) AS BU, IIf(IsNull([qryRecordsWithTBD].[BU]),"Complete","Incomplete") AS Complete
FROM qryID_and_BU LEFT JOIN qryRecordsWithTBD ON qryID_and_BU.BU = qryRecordsWithTBD.BU;
Code:
SELECT SharepointIDs_to_BusinessUnits.SharepointID, SharepointIDs_to_BusinessUnits.BusinessUnitID, SharepointIDs_to_BusinessUnits.BusinessUnitName, qryID_and_BU_CompleteStatus.Complete
FROM SharepointIDs_to_BusinessUnits LEFT JOIN qryID_and_BU_CompleteStatus ON SharepointIDs_to_BusinessUnits.BusinessUnitID = qryID_and_BU_CompleteStatus.BU;