Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Access Query
Message
 
 
To
28/06/2010 03:55:49
Rahul Murarka
Sys-Con Engineering
Kolkata, India
General information
Forum:
Microsoft Office
Category:
Access
Title:
Environment versions
Microsoft Office:
Office 2007
Miscellaneous
Thread ID:
01470768
Message ID:
01470786
Views:
36
>Dear Sir/Madam
>
>I Have Two Table of Transport Rates
>
>1) TableA
>Contains Rate from X to Location
>Location Prices
>A 11
>B 22
>C 33
>D 44
>E 55
>F 66
>G 77
>
>2) TableB
>
>Location Prices
>A 88
>B 99
>H 111
>I 222
>J 333
>K 444
>
>After Query Result I require is
>
>Location PricesA PricesB PriceDiff A-B (If A is Null Take it as 0)
>A 11 88
>B 22 99
>C 33 ---
>D 44 ----
>E 55 ----
>F 66 -----
>G 77 ----
>H ---- 111
>I ----- 222
>J ----- 333
>K ---- 444

Try
Select IIF(A.Location IS NULL, B,Location, A.Location) as Location, 
IIF(A.Prices IS NULL,0, A.Prices) as PricesA,
IIF(B.Prices IS NULL,0, B.Prices) as PricesB
from TableA A FULL OUTER JOIN TableB B on A.Location = B.Location
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform