I have three fields in a query that each give a decimal amount, the three are unique meaning if one is not null, the other two are null.
What I'm trying to do is place all three of these fields into one field I'll show an example
City Code 1 Code 2 Code3
San Juan 45.4
Lansing 35.12
Rapid City 65.4
Salem 41.54
What I want is:
City Codes
San Juan 45.4
Lansing 35.12
Rapid City 65.4
Salem 41.54
Here is my SQL code it only gives me the results of the initial query and not the two sub queries.
I think this code is the way to approach this problem, but I may be off. Any help is as always highly appreciated.
thanks in advance,
Layth
What I'm trying to do is place all three of these fields into one field I'll show an example
City Code 1 Code 2 Code3
San Juan 45.4
Lansing 35.12
Rapid City 65.4
Salem 41.54
What I want is:
City Codes
San Juan 45.4
Lansing 35.12
Rapid City 65.4
Salem 41.54
Here is my SQL code it only gives me the results of the initial query and not the two sub queries.
Code:
SELECT *,
[subMasterpiece].[Total] AS CombinedTotal
FROM [subMasterpiece]
WHERE [subMasterpiece].[REGTOTAL] is NULL
AND [subMasterpiece].[PROTOTAL] is NULL
OR EXISTS
(SELECT [subMasterpiece].[PROTOTAL] AS CombinedTotal
FROM [subMasterpiece]
WHERE [subMasterpiece].[Total] is NULL
AND [subMasterpiece].[REGTOTAL] is NULL
OR EXISTS
(SELECT [subMasterpiece].REGTOTAL AS CombinedTotal
FROM [subMasterpiece]
WHERE [subMasterpiece].[Total] is NULL
AND [subMasterpiece].[PROTOTAL] is NULL));
I think this code is the way to approach this problem, but I may be off. Any help is as always highly appreciated.
thanks in advance,
Layth