Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

MS Access Relationships -Help!

  • 14-12-2013 10:28PM
    #1
    Registered Users, Registered Users 2 Posts: 4,047 ✭✭✭


    I desperately need help with a project that is due in tomorrow.

    I'll try explain as best i can but can elaborate if I havent given enough info for anyone to help.

    I have two tables in access as follows:

    Employee (contains fields EmployeeID, Firstname, Lastname, JobTitle, Startdate, Salary, Dept, Manager)

    Appraisals (AppraisalId, Employee, Appraiser, Date, Rise)

    The fields Lastname& Firstname, Manager, Employee and Appraiser all refer to the same people.

    I have been asked to firstly use SQL for lookups from the appraisal table to the employee able using select employeeid, lastname&','&firstname from employee by order of 2. This gives me a dropdown list of all the staff. I think its meant to convert the employee id's in my appraisal table to names but i had to manually change them so I know I've done something wrong.

    Can anyone help...
    thank you...desperado :o


Comments

  • Registered Users, Registered Users 2 Posts: 329 ✭✭Cathalog


    I'm finding it a little difficult to understand the question being asked. I'd definitely recommend you look at it again and rephrase it :)

    You say that you think "its meant to convert the employee id's in my appraisal table to names". I can help you with doing this, but I can't guarantee it's the answer to the question, because I don't understand it :P

    In order to list every row in the Appraisals table, but show the employee name instead of the employee ID, both tables have to be used - I like using the INNER JOIN method, but you can also use a subquery method.

    Here's the SQL...
    SELECT AppraisalId, Lastname&", "&firstname, Appraiser, Date, Rise
    FROM Appraisals INNER JOIN Employee on Appraisals.Employee = Employee.EmployeeID;
    

    Like I said, I have no idea if that's the question being asked, so please test the code I gave you and check the results.


Advertisement