472,330 Members | 1,485 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,330 software developers and data experts.

Problem with query

12
hi,

I have a drop-down box whereever a name is to be entered so that a user can select a name from that.
I have to store the userid, but display the username.
While display, i am able to display the username, but in this particular form, where i have to display the username's of two columns: responsibility and chairperson,i am unable to write the query.How can it be written?

Below ive pasted the query which displays the username for column:responsibility, i want to display the username for both the columns

rs = st.executeQuery("select u.username,a.tobefollowedupby from table2 a,table1 u WHERE a.responsibility=u.userid");

Below, are the tables
Table 1: userid,username
Table 2: responsibility,chairperson


--------------------------------------------------------------------------------
May 14 '07 #1
2 1216
debasisdas
8,127 Expert 4TB
I dont think there is any relation ship between these two tables

and your query

"select u.username,a.tobefollowedupby from table2 a,table1 u WHERE a.responsibility=u.userid"

may not work.

beacuse it seems responsbility and userid columns must have different data type ,then how can u match on these two fields.
May 14 '07 #2
hi,

I have a drop-down box whereever a name is to be entered so that a user can select a name from that.
I have to store the userid, but display the username.
While display, i am able to display the username, but in this particular form, where i have to display the username's of two columns: responsibility and chairperson,i am unable to write the query.How can it be written?

Below ive pasted the query which displays the username for column:responsibility, i want to display the username for both the columns

rs = st.executeQuery("select u.username,a.tobefollowedupby from table2 a,table1 u WHERE a.responsibility=u.userid");

Below, are the tables
Table 1: userid,username
Table 2: responsibility,chairperson


--------------------------------------------------------------------------------
Hi,
i hope it may work well and help u.
select u.username responsibility,b.username chairperson
from table1 u,table1 b,table2 a
where u.userid = a.responsibility
and b.userid = a.chairperson

regards,
gangadhar
May 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Brian Oster | last post by:
After applying security patch MS03-031 (Sql server ver 8.00.818) a query that used to execute in under 2 seconds, now takes over 8 Minutes to...
8
by: Andrew McNab | last post by:
Hi folks, I have a problem with an MS Access SQL query which is being used in an Access Report, and am wondering if anyone can help. ...
4
by: Apple | last post by:
1. I want to create an autonumber, my requirement is : 2005/0001 (Year/autonumber), which year & autonumber no. both can auto run. 2. I had...
6
by: lenny | last post by:
Hi, I've been trying to use a Sub or Function in VBA to connect to a database, make a query and return the recordset that results from the...
3
by: StBond | last post by:
Hi everyone, I am new to Access and Visual Basic so things my be getting across a bit cloudy. I only started using VB for one week. I am...
3
by: Andy_Khosravi | last post by:
I have been trying to build a user friendly search engine for a small database I have created. I'm having some particular problems with one of my...
20
by: Development - multi.art.studio | last post by:
Hello everyone, i just upgraded my old postgres-database from version 7.1 to 7.4.2. i dumped out my 7.1 database (with pg_dump from 7.1) as an...
0
by: mjsterz | last post by:
I've been working with VB .NET for less than a year and this is the first time I've posted on one of these groups, so let me apologize beforehand...
3
by: Juan Antonio Villa | last post by:
Hello, I'm having a problem replicating a simple database using the binary log replication, here is the problem: When the master sends an update...
9
by: HC | last post by:
Hello, all, I started out thinking my problems were elsewhere but as I have worked through this I have isolated my problem, currently, as a...
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.