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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lookup tables

Status
Not open for further replies.

ro1016

Programmer
Mar 30, 2006
13
US
hi,

I'm not sure how i can join to a lookup table. I have two tables:applications and status.Now if I want applications
that have a particular status how do I select that? the
application table has a "status id" column and the status
table has status id and status description.

Thank you
 
Code:
Select Application.*, Status.Description
From   Application
       Inner Join Status 
         On Application.StatusId = Status.StatusId
Where  Status.Description = '[!]The status I want.[/!]'

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Thank you so much,gmmastros. I was doing that but I was not getting
any rows back. I guess I'm doing something else wrong.

thanks again
 
Post some sample data (from both tables) and the expected results. There may be something else going on that we can help you with.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Also, run this query and post the results back here.

Code:
Select Table_Name, Column_Name, Data_Type
From   Information_Schema.Columns 
Where  Table_Name In ('applications', 'Status')

This should tell us the data type for each column in both tables.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
I think I figured it out. It was another filter I was using
that was causing the problem.

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top