Ask a Question related to Macromedia ColdFusion, Design and Development.
-
MikeyJ #1
Display names from tbl 2 based on ID's in tbl1
Hi all,
Silly question I'm sure but it's escaping me at the moment.
Here's the important parts of 2 tables I have:
tblCallbacks
-----------------
CBID
CSR1
tblEmployees
-----------------
EmpID
EmpFirstName
On my data entry page I have a dropdown box that is populated from
tblEmployees. It's values are the EmpID's. These values are written into the
CSR1 field in tblCallbacks.
Question is...when I want to pull up a list of callbacks from tblCallbacks,
how do I show the name from tblEmployees instead of the ID in tblCallbacks.CSR1?
I just can't get the query for some reason....
Thx!
Mike
MikeyJ Guest
-
Display name based on date
Hi All, I am trying to put together a cfm page that will display a users name based on the day of the week. The user selects a range of dates that... -
ANN: SPi-V, Shockwave based panoramic display engine
Today I released my Shockwave based panoramic viewing engine. http://fieldofview.nl/press/041122_SPi-V I guess panoramic photography is a bit... -
display COM+ process id's in an asp page
Making a good old fashioned asp page and need to be able to display the IIS COM+ process id's (i.e. those that show up when attaching to a process... -
display text field based on the selection choices
I want to display credit card fields when the user selects the option paid membership. If user selects the option free membership, then the credit... -
How to display alternate text based on dynamic data?
I need to display alternate text based on returns from a record set. For example, when my recordset returns "21," which is a code for an employee... -
Kronin555 #2
Re: Display names from tbl 2 based on ID's in tbl1
select tblcallbacks.cbid, tblemployees.empfirstname
from
tblcallbacks JOIN tblemployees ON (tblcallbacks.csr1 = tblemployees.empid)
Kronin555 Guest
-
MikeyJ #3
Re: Display names from tbl 2 based on ID's in tbl1
Wow! Thx for the fast reply! Your solution works like a charm.
Now, to throw a curveball atcha. ;-)
I also have a field in tblCallbacks named CSR2. It works the same as CSR1 in
that it also holds an EmpID. How do I do the same for CSR2? I need to display
the corresponding names for both CSR1 and CSR2 in the same record.
Hope I explained well enough.
Thx again!
Mike
MikeyJ Guest
-
mxstu #4
Re: Display names from tbl 2 based on ID's in tbl1
You may need to add parenthesis to the JOIN statements depending on your
database....
SELECT cb.cbid, e1.empfirstname, e2.empfirstname
FROM tblcallbacks cb JOIN tblemployees e1 ON cb.csr1 = e1.empid
JOIN tblemployees e2 ON cb.csr2 = e2.empid
mxstu Guest
-
MikeyJ #5
Re: Display names from tbl 2 based on ID's in tbl1
Thanks! This worked perfectly.
In actuality, both yours and Kronin555's answers were correct and helped me move forward!
Mike
MikeyJ Guest



Reply With Quote

