Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table help...(link tables)

Status
Not open for further replies.

leslied

MIS
May 29, 2003
108
0
0
US
I have a table where I want to do a query...
however within one field in the table there are certain other ares that i want out of it... this is an example....
please bear with me....

The table looks like this:

pay_element_id tot_current_monetary_amt
ADVICE $0000000
A_TAXEARN $0000000
SALARY $0000000
SSEMP $0000000

This is the info I am looking at. This is what I would like to do: I want to filter certain info e.g. I want only to see, the ADVICE, A_TAXEARN and SALARY. Those are the only info I want to see, how do I do that. The following is what the SQL looks like:

SELECT dbo_emp_pmt_pay_element_detail.pay_element_id, dbo_emp_pmt_pay_element_detail.tot_current_monetary_amt
FROM dbo_emp_pmt_pay_element_detail;


I appreciate your help filks.
 
Let's say your table is named tblEmpInfo where all of the information you have inidcated is stored. Create a query and name itqryInfo off the table tblEmpInfo and drag only the few fields you want to the grid. Once the query is done you can then sort it however you wish. If you want to view this in a report, have the report off the query qryInfo.




HTH

An investment in knowledge always pays the best dividends.

by Benjamin Franklin
 
If I understand your question, you want to choose records where pay_element_id is one of the three values you've indicated. In this case you simply add a WHERE clause to your query:

SELECT dbo_emp_pmt_pay_element_detail.pay_element_id, dbo_emp_pmt_pay_element_detail.tot_current_monetary_amt
FROM dbo_emp_pmt_pay_element_detail
WHERE (((dbo_emp_pmt_pay_element_detail.pay_element_id)="ADVICE")) OR (((dbo_emp_pmt_pay_element_detail.pay_element_id)="A_TAXEARN")) OR (((dbo_emp_pmt_pay_element_detail.pay_element_id)="SALARY"));

Hope this helps,

RC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top