I have a query with fields like these:
SELECT (SELECT Sum (ABS (Quantity)) FROM Table1 WHERE Type= '1' and Code = ‘ X’ ) As Field1
,(SELECT Sum (ABS (Quantity)) FROM Table1 WHERE Type= '2' and Code= ‘ Y’ ) As Field 2
The query works correctly that far!
Now I want a field that is the addition of Field1 and Field2
I have tried , ( convert( int, Field1) + convert (int, Field2) ) As Field3
But that does not work!!
Is it because the Field1 and Field2 are not real fields? and if not, how do I do basic math with fields created with the AS syntax?