M
Mark Burns
Msft / Gurus:
OK, I have this query that RUNS, but Access can't save it without blowing
up.
(I was able to save the query by creating it directly with a SQL string and
DAO's
CreateQueryDef method.)
The Query will RUN just fine, but Access XP BLOWS UP if I try and SAVE the
query!
Each query (INCLUDING for the "outermost" one) works perfectly as
advertised.
Question: Why the heck does this blow up?
Crash Data:
Error Signature:
AppName: msaccess.exe AppVer: 10.0.4302.0 ModName: unknown
ModVer: 0.0.0.0 Offset: 0063015f
Exception Information:
Code: 0x000008d0 Flags: 0x00000000
Record: 0x00000000c0000005 Address:0x0000000000000000
<tons of other error details omitted>
Query Details:
The query is a rather complex query consisting of:
Outermost query (Where it blows up upon trying to SAVE the query):
2 Inner-joined Tables inner-joined to a Crosstab Query with 1 Date
Parameter
PARAMETERS [Balance AsOf Date:] DateTime;
SELECT HCILookupSchoolsList.Location, [StudentBackground].[Last] & ", " &
[StudentBackground].[FirstName] AS Name, [HCIStudentAR4DocTotalBalances Aged
AsOf Query_Crosstab].SSN, [HCIStudentAR4DocTotalBalances Aged AsOf
Query_Crosstab].SeqNo, [HCIStudentAR4DocTotalBalances Aged AsOf
Query_Crosstab].Current, [HCIStudentAR4DocTotalBalances Aged AsOf
Query_Crosstab].[Over 30], [HCIStudentAR4DocTotalBalances Aged AsOf
Query_Crosstab].[Over 60], [HCIStudentAR4DocTotalBalances Aged AsOf
Query_Crosstab].[Over 90], [HCIStudentAR4DocTotalBalances Aged AsOf
Query_Crosstab].[Total Of Balance]
FROM (StudentBackground INNER JOIN [HCIStudentAR4DocTotalBalances Aged AsOf
Query_Crosstab] ON (StudentBackground.SeqNo = [HCIStudentAR4DocTotalBalances
Aged AsOf Query_Crosstab].SeqNo) AND (StudentBackground.SSN =
[HCIStudentAR4DocTotalBalances Aged AsOf Query_Crosstab].SSN)) INNER JOIN
HCILookupSchoolsList ON StudentBackground.AccountNo =
HCILookupSchoolsList.AccountNo
ORDER BY StudentBackground.AccountNo, StudentBackground.Last,
StudentBackground.FirstName, [HCIStudentAR4DocTotalBalances Aged AsOf
Query_Crosstab].SSN, [HCIStudentAR4DocTotalBalances Aged AsOf
Query_Crosstab].SeqNo;
The Query: HCIStudentAR4DocTotalBalances Aged AsOf Query_Crosstab
A Crosstab query of a complex query with 1 date parameter (the parameter
passes througgh to the inner query)
PARAMETERS [Balance AsOf Date:] DateTime;
TRANSFORM Sum([HCIStudentAR4DocTotalBalances Aged AsOf Query].Balance) AS
SumOfBalance
SELECT [HCIStudentAR4DocTotalBalances Aged AsOf Query].SSN,
[HCIStudentAR4DocTotalBalances Aged AsOf Query].SeqNo,
Sum([HCIStudentAR4DocTotalBalances Aged AsOf Query].Balance) AS [Total Of
Balance]
FROM [HCIStudentAR4DocTotalBalances Aged AsOf Query]
GROUP BY [HCIStudentAR4DocTotalBalances Aged AsOf Query].SSN,
[HCIStudentAR4DocTotalBalances Aged AsOf Query].SeqNo
ORDER BY [HCIStudentAR4DocTotalBalances Aged AsOf Query].SSN,
[HCIStudentAR4DocTotalBalances Aged AsOf Query].SeqNo
PIVOT [HCIStudentAR4DocTotalBalances Aged AsOf Query].C369;
The Query [HCIStudentAR4DocTotalBalances Aged AsOf Query]:
A complex query with 6 tables, inner and outer joins, and a UNION query
inner joined as well.
SELECT HCIStudentDocs.DocumentID, HCIStudentDocs.SSN, HCIStudentDocs.SeqNo,
HCIStudentDocs.DocTotalDue, HCIStudentDocs.DocTotalRecvd,
HCIStudentDocs.AllAmtsRecvd, HCIStudentDocs.Note,
Sum(IIf([DebitOrCredit]="D",[Amount],0)) AS DebitAmount,
Sum(IIf([DebitOrCredit]="C",[Amount],0)) AS CreditAmount,
[DebitAmount]-[CreditAmount] AS Balance, Max(T3T4ARUNION.DateRecvd) AS
LastDate, DateDiff("d",Max([DateRecvd]),[Balance AsOf Date:]) AS Days,
IIf([Days]<30,"Current",IIf([days]<60,"Over 30",IIf([days]<90,"Over
60","Over 90"))) AS C369
FROM (HCIDocumentTypesInfo INNER JOIN HCIStudentDocs ON
HCIDocumentTypesInfo.DocumentTypeID = HCIStudentDocs.DocumentTypeID) INNER
JOIN ((HCIPostingStatusIDs INNER JOIN (HCILookupPostingPeriodsList RIGHT
JOIN (HCIStudentDocLine LEFT JOIN HCICorpPostingPeriods ON
HCIStudentDocLine.PostingPeriodID = HCICorpPostingPeriods.PostingPeriodID)
ON HCILookupPostingPeriodsList.PostingSpanID =
HCICorpPostingPeriods.PostingSpanID) ON HCIPostingStatusIDs.PostingStatusID
= HCIStudentDocLine.PostingStatusID) INNER JOIN T3T4ARUNION ON
HCIStudentDocLine.TransactionID = T3T4ARUNION.TransactionID) ON
HCIStudentDocs.DocumentID = HCIStudentDocLine.DocumentID
WHERE (((HCIDocumentTypesInfo.Abbreviation)="AR4") AND
((HCIPostingStatusIDs.PostingStatusText)<>"CANCELLED") AND
((T3T4ARUNION.Recvd)=True) AND ((T3T4ARUNION.DateRecvd)<=[Balance AsOf
Date:]))
GROUP BY HCIStudentDocs.DocumentID, HCIStudentDocs.SSN,
HCIStudentDocs.SeqNo, HCIStudentDocs.DocTotalDue,
HCIStudentDocs.DocTotalRecvd, HCIStudentDocs.AllAmtsRecvd,
HCIStudentDocs.Note
ORDER BY HCIStudentDocs.SSN, HCIStudentDocs.SeqNo;
The inner-joined UNION Query:
SELECT Title3ItemizationOfFinancing.SSN, Title3ItemizationOfFinancing.SeqNo,
Title3ItemizationOfFinancing.TransactionID,
Title3ItemizationOfFinancing.FinanceCategory,
Title3ItemizationOfFinancing.AmountBilled AS NetAmount,
Title3ItemizationOfFinancing.DateDue, Title3ItemizationOfFinancing.Recvd,
Title3ItemizationOfFinancing.ActualAmount,
Title3ItemizationOfFinancing.DateRecvd,
HCIPostingStatusIDs.PostingStatusText
FROM Title3ItemizationOfFinancing INNER JOIN HCIPostingStatusIDs ON
Title3ItemizationOfFinancing.PostingStatusID =
HCIPostingStatusIDs.PostingStatusID
UNION SELECT ItemizationOfFinancing.SSN, ItemizationOfFinancing.SeqNo,
ItemizationOfFinancing.TransactionID,
ItemizationOfFinancing.FinanceCategory, ItemizationOfFinancing.NetAmount,
ItemizationOfFinancing.DateDue, ItemizationOfFinancing.Recvd,
ItemizationOfFinancing.ActualAmount, ItemizationOfFinancing.DateRecvd,
HCIPostingStatusIDs.PostingStatusText
FROM ItemizationOfFinancing INNER JOIN HCIPostingStatusIDs ON
ItemizationOfFinancing.PostingStatusID = HCIPostingStatusIDs.PostingStatusID
ORDER BY TransactionID, SSN, SeqNo, FinanceCategory;
- Mark
OK, I have this query that RUNS, but Access can't save it without blowing
up.
(I was able to save the query by creating it directly with a SQL string and
DAO's
CreateQueryDef method.)
The Query will RUN just fine, but Access XP BLOWS UP if I try and SAVE the
query!
Each query (INCLUDING for the "outermost" one) works perfectly as
advertised.
Question: Why the heck does this blow up?
Crash Data:
Error Signature:
AppName: msaccess.exe AppVer: 10.0.4302.0 ModName: unknown
ModVer: 0.0.0.0 Offset: 0063015f
Exception Information:
Code: 0x000008d0 Flags: 0x00000000
Record: 0x00000000c0000005 Address:0x0000000000000000
<tons of other error details omitted>
Query Details:
The query is a rather complex query consisting of:
Outermost query (Where it blows up upon trying to SAVE the query):
2 Inner-joined Tables inner-joined to a Crosstab Query with 1 Date
Parameter
PARAMETERS [Balance AsOf Date:] DateTime;
SELECT HCILookupSchoolsList.Location, [StudentBackground].[Last] & ", " &
[StudentBackground].[FirstName] AS Name, [HCIStudentAR4DocTotalBalances Aged
AsOf Query_Crosstab].SSN, [HCIStudentAR4DocTotalBalances Aged AsOf
Query_Crosstab].SeqNo, [HCIStudentAR4DocTotalBalances Aged AsOf
Query_Crosstab].Current, [HCIStudentAR4DocTotalBalances Aged AsOf
Query_Crosstab].[Over 30], [HCIStudentAR4DocTotalBalances Aged AsOf
Query_Crosstab].[Over 60], [HCIStudentAR4DocTotalBalances Aged AsOf
Query_Crosstab].[Over 90], [HCIStudentAR4DocTotalBalances Aged AsOf
Query_Crosstab].[Total Of Balance]
FROM (StudentBackground INNER JOIN [HCIStudentAR4DocTotalBalances Aged AsOf
Query_Crosstab] ON (StudentBackground.SeqNo = [HCIStudentAR4DocTotalBalances
Aged AsOf Query_Crosstab].SeqNo) AND (StudentBackground.SSN =
[HCIStudentAR4DocTotalBalances Aged AsOf Query_Crosstab].SSN)) INNER JOIN
HCILookupSchoolsList ON StudentBackground.AccountNo =
HCILookupSchoolsList.AccountNo
ORDER BY StudentBackground.AccountNo, StudentBackground.Last,
StudentBackground.FirstName, [HCIStudentAR4DocTotalBalances Aged AsOf
Query_Crosstab].SSN, [HCIStudentAR4DocTotalBalances Aged AsOf
Query_Crosstab].SeqNo;
The Query: HCIStudentAR4DocTotalBalances Aged AsOf Query_Crosstab
A Crosstab query of a complex query with 1 date parameter (the parameter
passes througgh to the inner query)
PARAMETERS [Balance AsOf Date:] DateTime;
TRANSFORM Sum([HCIStudentAR4DocTotalBalances Aged AsOf Query].Balance) AS
SumOfBalance
SELECT [HCIStudentAR4DocTotalBalances Aged AsOf Query].SSN,
[HCIStudentAR4DocTotalBalances Aged AsOf Query].SeqNo,
Sum([HCIStudentAR4DocTotalBalances Aged AsOf Query].Balance) AS [Total Of
Balance]
FROM [HCIStudentAR4DocTotalBalances Aged AsOf Query]
GROUP BY [HCIStudentAR4DocTotalBalances Aged AsOf Query].SSN,
[HCIStudentAR4DocTotalBalances Aged AsOf Query].SeqNo
ORDER BY [HCIStudentAR4DocTotalBalances Aged AsOf Query].SSN,
[HCIStudentAR4DocTotalBalances Aged AsOf Query].SeqNo
PIVOT [HCIStudentAR4DocTotalBalances Aged AsOf Query].C369;
The Query [HCIStudentAR4DocTotalBalances Aged AsOf Query]:
A complex query with 6 tables, inner and outer joins, and a UNION query
inner joined as well.
SELECT HCIStudentDocs.DocumentID, HCIStudentDocs.SSN, HCIStudentDocs.SeqNo,
HCIStudentDocs.DocTotalDue, HCIStudentDocs.DocTotalRecvd,
HCIStudentDocs.AllAmtsRecvd, HCIStudentDocs.Note,
Sum(IIf([DebitOrCredit]="D",[Amount],0)) AS DebitAmount,
Sum(IIf([DebitOrCredit]="C",[Amount],0)) AS CreditAmount,
[DebitAmount]-[CreditAmount] AS Balance, Max(T3T4ARUNION.DateRecvd) AS
LastDate, DateDiff("d",Max([DateRecvd]),[Balance AsOf Date:]) AS Days,
IIf([Days]<30,"Current",IIf([days]<60,"Over 30",IIf([days]<90,"Over
60","Over 90"))) AS C369
FROM (HCIDocumentTypesInfo INNER JOIN HCIStudentDocs ON
HCIDocumentTypesInfo.DocumentTypeID = HCIStudentDocs.DocumentTypeID) INNER
JOIN ((HCIPostingStatusIDs INNER JOIN (HCILookupPostingPeriodsList RIGHT
JOIN (HCIStudentDocLine LEFT JOIN HCICorpPostingPeriods ON
HCIStudentDocLine.PostingPeriodID = HCICorpPostingPeriods.PostingPeriodID)
ON HCILookupPostingPeriodsList.PostingSpanID =
HCICorpPostingPeriods.PostingSpanID) ON HCIPostingStatusIDs.PostingStatusID
= HCIStudentDocLine.PostingStatusID) INNER JOIN T3T4ARUNION ON
HCIStudentDocLine.TransactionID = T3T4ARUNION.TransactionID) ON
HCIStudentDocs.DocumentID = HCIStudentDocLine.DocumentID
WHERE (((HCIDocumentTypesInfo.Abbreviation)="AR4") AND
((HCIPostingStatusIDs.PostingStatusText)<>"CANCELLED") AND
((T3T4ARUNION.Recvd)=True) AND ((T3T4ARUNION.DateRecvd)<=[Balance AsOf
Date:]))
GROUP BY HCIStudentDocs.DocumentID, HCIStudentDocs.SSN,
HCIStudentDocs.SeqNo, HCIStudentDocs.DocTotalDue,
HCIStudentDocs.DocTotalRecvd, HCIStudentDocs.AllAmtsRecvd,
HCIStudentDocs.Note
ORDER BY HCIStudentDocs.SSN, HCIStudentDocs.SeqNo;
The inner-joined UNION Query:
SELECT Title3ItemizationOfFinancing.SSN, Title3ItemizationOfFinancing.SeqNo,
Title3ItemizationOfFinancing.TransactionID,
Title3ItemizationOfFinancing.FinanceCategory,
Title3ItemizationOfFinancing.AmountBilled AS NetAmount,
Title3ItemizationOfFinancing.DateDue, Title3ItemizationOfFinancing.Recvd,
Title3ItemizationOfFinancing.ActualAmount,
Title3ItemizationOfFinancing.DateRecvd,
HCIPostingStatusIDs.PostingStatusText
FROM Title3ItemizationOfFinancing INNER JOIN HCIPostingStatusIDs ON
Title3ItemizationOfFinancing.PostingStatusID =
HCIPostingStatusIDs.PostingStatusID
UNION SELECT ItemizationOfFinancing.SSN, ItemizationOfFinancing.SeqNo,
ItemizationOfFinancing.TransactionID,
ItemizationOfFinancing.FinanceCategory, ItemizationOfFinancing.NetAmount,
ItemizationOfFinancing.DateDue, ItemizationOfFinancing.Recvd,
ItemizationOfFinancing.ActualAmount, ItemizationOfFinancing.DateRecvd,
HCIPostingStatusIDs.PostingStatusText
FROM ItemizationOfFinancing INNER JOIN HCIPostingStatusIDs ON
ItemizationOfFinancing.PostingStatusID = HCIPostingStatusIDs.PostingStatusID
ORDER BY TransactionID, SSN, SeqNo, FinanceCategory;
- Mark