Subject: Select a value across 3 different columns
Posted By: jfergy Post Date: 1/23/2006 1:46:15 AM
Hello-

I have an owners table where there are 3 columns cnumber, cnumber2, cnumber3. When an owner logs in they choose which company they want to edit and that gets sent to a session variable called companyiD. How can I tell all my queries to pull only data that matches that companyID? In other words an owner may have 3 companies he chooses a company that is cnumber2. Rather than creating a column and companyID variable i want to have the query look at all 3 columns for that companyId and pull the values. Below is what i think might work but any help would be appreciated.

"Select * from gen_liability_form where Year_Completed = '" & ThisYear & "' and Session("CompanyID")IN (Select * from owners where cnumber, cnumber2,or cnumber3 = companyID)"



Go to topic 37415

Return to index page 388
Return to index page 387
Return to index page 386
Return to index page 385
Return to index page 384
Return to index page 383
Return to index page 382
Return to index page 381
Return to index page 380
Return to index page 379