Here's my (not working) SHAPEd query, can you tell me whats wrong here:
"SHAPE {SELECT TblNode.TblNodeID, TblNode.NodeLabel, "_
& "Sum(QryLevel3CostTotals.SumOfBudget) AS SumOfSumOfBudget, "_
& "Sum(QryLevel3CostTotals.SumOfVariation) AS SumOfSumOfVariation, "_
& "Sum(QryLevel3CostTotals.LastOfCommitted) AS SumOfLastOfCommitted, "_
& "Sum(QryLevel3CostTotals.LastOfActual) AS SumOfLastOfActual, "_
& "Sum(QryLevel3CostTotals.LastOfWork) AS SumOfLastOfWork, "_
& "Sum(QryLevel3CostTotals.LastOfAccrual) AS SumOfLastOfAccrual "_
& "FROM TblNode"_
& "GROUP BY TblNode.TblNodeID, TblNode.NodeLabel} "_
&"APPEND {SELECT TblNode.TblNodeID, TblNode.NodeLabel,
TblMainEntry.cbsID, TblCBSandBudget.CBSdescription, " _
& "Sum(TblCBSandBudget.Budget) AS SumOfBudget, "_
&
"Sum(IIf(IsNull([TblMainEntry].[Variation]),0,[TblMainEntry].[Variation]
)) AS SumOfVariation, " _
&
"Last(IIf(IsNull([TblMainEntry].[Committed]),0,[TblMainEntry].[Committed
])) AS LastOfCommitted, " _
& "Last(IIf(IsNull([TblMainEntry].[Actual]),0,[TblMainEntry].[Actual]))
AS LastOfActual," _
& "Last(IIf(IsNull([TblMainEntry].[Worked]),0,[TblMainEntry].[Worked]))
AS LastOfWork," _
&
"Last(IIf(IsNull([TblMainEntry].[Accrual]),0,[TblMainEntry].[Accrual]))
AS LastOfAccrual," _
&
"Last(IIf(IsNull([TblMainEntry].[EntryDate]),0,[TblMainEntry].[EntryDate
])) AS LastOfEntryDate " _
& "FROM (TblMainEntry RIGHT JOIN TblCBSandBudget ON TblMainEntry.cbsID
= TblCBSandBudget.cbsID) " _
& "INNER JOIN TblNode ON TblCBSandBudget.NodeID = TblNode.TblNodeID " _
& "GROUP BY TblNode.TblNodeID, TblNode.NodeLabel, TblMainEntry.cbsID,
TblCBSandBudget.CBSdescription " _
& "HAVING
(((Last(IIf(IsNull([TblMainEntry].[EntryDate]),0,[TblMainEntry].[EntryDa
te])))<#9/1/2003#))"_
& "} AS QryLevel3CostTotals "_
&"RELATE {TblNodeID TO TblNodeID}"