dbTalk Databases Forums  

Re: Using table field in query constraints

comp.database.ms-access comp.database.ms-access


Discuss Re: Using table field in query constraints in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
tom
 
Posts: n/a

Default Re: Using table field in query constraints - 08-19-2003 , 11:35 PM






use an embedded SQL statement and the IN keyword, i.e., SELECT * FROM
Table WHERE sal IN (SELECT [Second_Table].[value] FROM
[Second_Table]). this will get everything from the first table where
the value matches something in the value field of the second table.

tom

steven.krizanovic (AT) cba (DOT) com.au (Steve) wrote in message news:<198dc354.0308131558.1ac4a5af (AT) posting (DOT) google.com>...
Quote:
Hi,

I am using Access 97. I have two tables, one contains employee
information, including salary information. the second contains
constrains to be used in a query to get a cross section of
information. I know you can write a SQL with the constrain 'WHERE sal
= [second_Table].[value]'. eg [value] = '50000'

My question is how can i include the whole constraint in the
[second_table].[value] eg [value] = '>=50000' so some how the SQL
looks like 'WHERE sal is [second_table].[value] ('IS' does not work).
so in theory, the WHERE statement is exactly the same as the first?

Thanks in advance

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.