April15Hater
Accountant
- Local time
- Today, 15:02
- Joined
- Sep 12, 2008
- Messages
- 349
Hey guys-
I have a tabular query that is based off of a crosstab query. My problem is that whenever I try to add a string field to my problem query, it shows an Asian character (not sure which language) and a square. I know it's not corruption because I double checked the table and it's in the table correctly. Meanwhile if I add another date or number field, it works fine. Please also see the attached screen shot. Any ideas?
Problem Query:
qxtInvoiceFunction:
Note: The Aerial, Underground, Unit, and Setup columns in the Problem Query are the static column headings for qxtInvoiceFunction
I have a tabular query that is based off of a crosstab query. My problem is that whenever I try to add a string field to my problem query, it shows an Asian character (not sure which language) and a square. I know it's not corruption because I double checked the table and it's in the table correctly. Meanwhile if I add another date or number field, it works fine. Please also see the attached screen shot. Any ideas?
Problem Query:
Code:
SELECT qxtInvoiceFunction.ProductionID, qxtInvoiceFunction.TrackingNumber, qxtInvoiceFunction.Aerial, qxtInvoiceFunction.Underground, qxtInvoiceFunction.Unit, qxtInvoiceFunction.Setup, Sum(IIf([tblInvoiceFunction].[FunctionType]='Aerial',[Aerial]*DLookUp("price","tblInvoiceFunction","[tblInvoiceFunction].[FunctionType]='Aerial' And [tblInvoiceFunction].[FunctionID]=196"),0)) AS AerialPrice, Sum(IIf([tblInvoiceFunction].[FunctionType]='Underground',[Underground]*DLookUp("price","tblInvoiceFunction","[tblInvoiceFunction].[FunctionType]='Underground' And [tblInvoiceFunction].[FunctionID]=196"),0)) AS UGPrice, Sum(IIf([tblInvoiceFunction].[FunctionType]='Unit',[Unit]*DLookUp("price","tblInvoiceFunction","[tblInvoiceFunction].[FunctionType]='Unit' And [tblInvoiceFunction].[FunctionID]=196"),0)) AS UnitPrice, Sum(IIf([tblInvoiceFunction].[FunctionType]='Setup',[Setup]*DLookUp("price","tblInvoiceFunction","[tblInvoiceFunction].[FunctionType]='Setup' And [tblInvoiceFunction].[FunctionID]=196"),0)) AS SetupPrice, tblProductionInput.FinalizeDate
FROM tblInvoiceFunction, qxtInvoiceFunction INNER JOIN tblProductionInput ON qxtInvoiceFunction.ProductionID = tblProductionInput.ProductionID
WHERE (((qxtInvoiceFunction.FunctionID)=196))
GROUP BY qxtInvoiceFunction.ProductionID, qxtInvoiceFunction.TrackingNumber, qxtInvoiceFunction.Aerial, qxtInvoiceFunction.Underground, qxtInvoiceFunction.Unit, qxtInvoiceFunction.Setup, tblProductionInput.FinalizeDate;
Code:
TRANSFORM Sum(tblProductionInputDetail.ProductionUnits) AS SumOfProductionUnits
SELECT tblProductionInputDetail.ProductionID, tblProductionTracking.TrackingNumber, tblProductionInput.FunctionID
FROM tblFunctionTracking INNER JOIN (tblContractorFunction INNER JOIN ((tblProductionInput INNER JOIN tblProductionInputDetail ON tblProductionInput.ProductionID = tblProductionInputDetail.ProductionID) INNER JOIN tblProductionTracking ON (tblProductionInput.ProductionID = tblProductionTracking.ProductionID) AND (tblProductionInput.ProductionID = tblProductionTracking.ProductionID)) ON tblContractorFunction.ContractorFunctionID = tblProductionInputDetail.ContractorFunctionID) ON tblFunctionTracking.FunctionTrackingID = tblProductionTracking.FunctionTrackingID
WHERE (((IsNull([Hierarchy]))=False) AND ((tblContractorFunction.FunctionType)="aerial" Or (tblContractorFunction.FunctionType)="underground" Or (tblContractorFunction.FunctionType)="unit" Or (tblContractorFunction.FunctionType)="setup") AND ((tblProductionInput.FunctionID)=196) AND ((tblProductionTracking.TrackingOnly)=False) AND ((tblProductionTracking.SourceData)=False))
GROUP BY tblProductionInputDetail.ProductionID, tblProductionTracking.TrackingNumber, IsNull([Hierarchy]), tblProductionInput.FunctionID, tblProductionTracking.TrackingOnly, tblProductionTracking.SourceData
PIVOT tblContractorFunction.FunctionType In (Aerial, Underground, Unit, Setup);