[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 897
  • Last Modified:

how to use alias in MS access

i have a table
Id
CountSubmitted
countA1
CountA2
countA3
countB1
CountB2
countB3

select * from table
1  100   25 25 25 15 5 5
select Id,CountSubmitted, 
countA1+countA2+countA3 as CountA,
countB1+countB2+countB3 as CountB
where CountSubmitted<> CountA+CountB
 
but ut does not recognise CountA+CountB and i am using:
select Id,CountSubmitted, 
countA1+countA2+countA3 as CountA,
countB1+countB2+countB3 as CountB
where CountSubmitted<> countA1+countA2+countA3 +countB1+countB2+countB3

Open in new window

0
rfedorov
Asked:
rfedorov
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
AFAIK, you cannot use the aliases immediatelyy.
0
 
rfedorovAuthor Commented:

It was fast...
what to do?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you have already 1 alternative.

here is another:
select *
from (
  select Id,CountSubmitted, countA1+countA2+countA3 as CountA, countB1+countB2+countB3 as CountB
    from table
  ) sq
where CountSubmitted <> CountA+CountB

Open in new window

0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now