• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 591
  • Last Modified:

MS Access where in clause

Is it possible to write a where in clause in MS Access SQL?

Example:

select * from mytable where myfield in (select top 6 myfieldlookup from othertable) as t1
0
dougfosterNYC
Asked:
dougfosterNYC
  • 2
  • 2
1 Solution
 
Rey Obrero (Capricorn1)Commented:
yes..



0
 
Rey Obrero (Capricorn1)Commented:
this is already good to go

select * from mytable where myfield in (select top 6 myfieldlookup from othertable)
0
 
dougfosterNYCAuthor Commented:
OMG.  It is the as t1 statement that screwed it up.  
 
Thanks....
0
 
rockiroadsCommented:
two things

with this, the table alias cannot be placed here like this (as t1). you would place it within the from part
second, myfield must match the datatype of myfieldlookup

select * from mytable where myfield in (select top 6 myfieldlookup from othertable)

0
 
rockiroadsCommented:
way too slow lol
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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