SQL calculated field not showing in ASP page
Posted on 2004-09-03
I am running into a weird problem. I have a SQL that generates results which include a calculated field:
WHEN sp_Action_Flag = 'P' THEN (A_Prices.Price - (A_Prices.Price * sp_Action_Amount))
WHEN sp_Action_Flag = 'F' THEN (A_Prices.Price - sp_Action_Amount)
WHEN sp_Action_Flag = 'L' THEN (sp_Action_Amount)
In SQL Query Analyzer and in the test results of Dreamweaver the results come back fine. However, when I actually view the page in a browser it doesn't show the A_Prices.Price. For example:
This displays the correct value for rsItems("CalculatedPrice") but displays nothing for rsItems("Price"). If I flip the two around, it all works:
Is there a reason I cannot access the information in PRICE if CALCULATEDPRICE is referrenced first? Is there a work around or better way to do this without having to displayed my SQL generated result last? I'm mean, I can always do the calculation in ASP and bypass the SQL, but that's so much more convenient. Is there just a limitation when I want to do this stuff in SQL? Thanks!
I'm running Windows 2000 Server and MS SQL Server 2000 Developers Edition.