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
--------------------------------------------------------------------------------
2 1216
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.
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
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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.
...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
|
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...
|
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...
|
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.
...
|
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...
| |