Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 23rd, 2006, 02:46 AM
Authorized User
 
Join Date: Jan 2006
Location: , , .
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default Select a value across 3 different columns

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.

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
SELECT VARIABLE Number of columns drani Oracle 4 September 21st, 2008 01:12 AM
Concatenating Columns in SELECT Problem kevorkian SQL Server 2000 6 June 13th, 2008 02:50 PM
Select row in GridView WITHOUT using Select button rao965 ASP.NET 2.0 Professional 1 February 15th, 2008 10:44 AM
Fill select box and select recordset value markd Classic ASP Databases 1 February 20th, 2006 06:41 PM
vb script + excel - select multiple columns mohit Excel VBA 1 January 21st, 2005 06:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.