MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old August 24th, 2004, 11:09 AM
boro1010 boro1010 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 3 boro1010 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Help with a Query

Please could someone help with the following problem...

Here are the tables relevent to my question:

tblProjects
*ProjectID
ProjectTitle
StartDate
EndDate

tblEmployees
*EmployeeID
LastName
FirstName
Etc...

tblAssignation
*AssignationID
ProjectID
EmployeeID
AssignedHours

When the user is entering data into the assignation table, i want them to be able to use a combo box to view the EmployeeID field, only i don't want them to see the EmployeeID, i want them to see the corresponding LastName. And in reverse, when they select the LastName i want the corresponding EmployeeID to be entered into the record.

Any ideas would be much appreciated.

Thanks in anticipation.

Reply With Quote
  #2  
Old August 24th, 2004, 01:09 PM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 31 m 56 sec
Reputation Power: 8
What type of form is this? HTML, MS Access, Visual Basic, .Net? If it is HTML you can set the value equal to the employeeID. If it is one of the others you will need to perform a query to resolve the name to the id. You will need to handle duplicate names though.
__________________
El éxito consiste en una serie de pequeñas victorias día a día

MySQL, MS SQL, MS ACCESS, Oracle Database Manager - http://victorpendleton.net/products/psdviewer.html

Reply With Quote
  #3  
Old August 25th, 2004, 03:52 AM
boro1010 boro1010 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 3 boro1010 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
In MS Access format.

I want to create the query in the lookup tab of the table's design view.

Reply With Quote
  #4  
Old August 25th, 2004, 08:29 AM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 31 m 56 sec
Reputation Power: 8
How will you handle the possibilty of two Joe Users?
When a user highlights a name and submits the form you could:
Run a query to resolve the employeeID
select employeeID from employees where name = [passed_value]
Then create your insert statement
Insert into assignment values(employeeID, assignment)

Reply With Quote
  #5  
Old August 25th, 2004, 09:26 AM
boro1010 boro1010 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 3 boro1010 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up

Victor,

Thanks very much for taking the time to think about my question and post you replies.

I've managed to solve the problem, taking on board your suggestions for multiple entries of the same name.

Thanks again.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Help with a Query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway