andreas_udby
Registered User.
- Local time
- Today, 15:12
- Joined
- May 7, 2001
- Messages
- 76
I have a calculated query, one of a dozen. They all work correctly except this one, which insists on treating two variables (certSales and certSales _wo) as if they were String instead of Numeric. Here's the SQL statement:
SELECT qrySegment.[Business Segment],
(Nz([HC_Sales],0)) AS certSales,
(Nz([HC_Sales_wo],0)) AS certSales_wo,
IIf([certSales]=0,0,(((Nz([GB_Sales],0))+(Nz([BB_Sales],0))+(Nz([MBB_Sales],0))+(Nz([QL_Sales],0)))/(Nz([certSales],0)))) AS current_certSales,
IIf([certSales_wo]=0,0,(((Nz([GB_Sales_wo],0))+(Nz([BB_Sales_wo],0))+(Nz([MBB_Sales_wo],0))+(Nz([QL_Sales_wo],0)))/(Nz([certSales_wo],0)))) AS current_certSales_wo
FROM ... yada yada.
This statement is identical to the other eleven, except that each queries values from a different set of preceding queries. When I went back and investigated the queries that feed this one, I couldn't find any errors or misattributions.
I've also checked the appropriate columns in the query design grid to see if anything was screwed up in the Field Properties, but no such luck. I'm stumped as to why those two variables are coming back as String values. Anyone have any ideas? Should I delete the query and write it over again?
Thanks,
Andreas
SELECT qrySegment.[Business Segment],
(Nz([HC_Sales],0)) AS certSales,
(Nz([HC_Sales_wo],0)) AS certSales_wo,
IIf([certSales]=0,0,(((Nz([GB_Sales],0))+(Nz([BB_Sales],0))+(Nz([MBB_Sales],0))+(Nz([QL_Sales],0)))/(Nz([certSales],0)))) AS current_certSales,
IIf([certSales_wo]=0,0,(((Nz([GB_Sales_wo],0))+(Nz([BB_Sales_wo],0))+(Nz([MBB_Sales_wo],0))+(Nz([QL_Sales_wo],0)))/(Nz([certSales_wo],0)))) AS current_certSales_wo
FROM ... yada yada.
This statement is identical to the other eleven, except that each queries values from a different set of preceding queries. When I went back and investigated the queries that feed this one, I couldn't find any errors or misattributions.
I've also checked the appropriate columns in the query design grid to see if anything was screwed up in the Field Properties, but no such luck. I'm stumped as to why those two variables are coming back as String values. Anyone have any ideas? Should I delete the query and write it over again?
Thanks,
Andreas