I have doubt in access query…
Pls advise is it possible
i have linked the excel file into access,its has some number of columns ..My ques is
for E.g
To retrieve the description and Region column from laptop,Desktop table
i do use below query
SELECT Laptop.[Description], Laptop.[Region] From Laptop
union SELECT Desktop.[Description], Desktop.[Region] From Desktop
sometimes ..It may not contain Region field, in that time I do use “ ” as Laptop.[Region] or “” as Desktop.[Region]
My quest is
Is there any option like this
SELECT Laptop.[Description], If Laptop.[Region]=avairable
then Laptop.[Region] else “” as [Region] from Laptop;
or any way to skip from error…
Please help me in this …THx in advance
Doubt:
To be clear
If desktop table has description and region Column ..
Description Region Saran east Sathish north sathy west
And
Laptop has Desktop table has description and Cost …
Description Cost asdf 23 dkasfjasd 34 flkasdf 55
Select Laptop.[Description], NZ(Laptop.[Region], "NA") as [Region]
from Laptop
UNION
SELECT Desktop.[Description], NZ(Desktop.[Region], "NA") as [Region]
FROM Desktop;
Will it return this result ?
I can’t run this because I had some access issue
Description Region asdf dkasfjasd flkasdf Saran east Sathish north sathy west
you can use switch case for this query but in mS-acess its not supported but the other way out of doing it in access is use of iif() here I am giving you a generic example you can easily convert this in your actual query.