Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > Visual Studio 2005
|
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2005 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
 
Old July 30th, 2007, 08:40 PM
Authorized User
 
Join Date: May 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default retrieve 2 different results on column

Hi

Please help!

How to retrieve 2 different results on 1 column 2 rows for one table using VB.net for web project?

Thanks


 
Old July 30th, 2007, 08:44 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Could you be a little more descriptive with your question? Perhaps provide an example of the data you have and how you want it to look.

-Peter
 
Old July 31st, 2007, 03:31 PM
Registered User
 
Join Date: May 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, Peter,

Retrieve different data from The same table and same column(field) for a form

This is reports on website. The report has 3 fields from 3 tables( Acturally many link tables)
For example:
__________________________________________________ ____________________________________________
Type ( from Type table) User Name(from User table), Firm Name(From Firm table)
A John A1 Firm
A John A2 Firm
A Joe A3 firm
A Joe A4 firm

B Reb B1 firm
B Reb B2 firm
B Mary B1 firm
__________________________________________________ _______________________________________
If type is “A”, will retrieve user name John, joe … and Frim Name A1, A2… Each user name has more than one firms
If type is “B”, will retrieve user name Reb, Mary … and Frim B1, B2…
Each user name has more than one firms
I use the code below:

SELECT allt(user.uname)+ allt(user.name2) as name, allt(firm.fname) as firm FROM user inner join type on user.user_id = type.user_id
inner join firm on type.type_id = firm.pty_id
where type.type="A and Id=@id

SELECT allt(user.uname)+ allt(user.name2) as name, allt(firm.fname) as firm FROM user inner join type on user.user_id = type.user_id
inner join firm on type.type_id = firm.pty_id
where type.type="B” and Id= @id

How to code together for a form?
Thanks.





Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView - Hide column and retrieve value snufse ASP.NET 2.0 Basics 1 July 24th, 2008 03:22 PM
Edit Query Results in Results Grid druid2112 SQL Server 2005 1 June 28th, 2007 08:49 AM
how to Retrieve Column Names Using SQL Query saravananedu Oracle 2 September 10th, 2005 01:57 AM
retrieve and display selected results babywind BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 February 11th, 2005 05:23 AM
Compare two Items of data(in column A and column B ever Excel VBA 6 February 13th, 2004 02:19 PM





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