Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
simflex
Constraint Violating Yak Guru
327 Posts |
Posted - 2002-09-15 : 15:09:02
|
| dear gurus!I have a table called courses, another called hr.Within courses table, I have a field called course and another called requiredCourse and yet another called recommendedCourse and another called positionNo.Then in the hr table, there is a field called positionNo (primary key), a key field called positionTitle, fname, lname and hiredate.What I would like to do is write a code that says give me all the required courses and the name of the employees who are supposed to take them.Have they taken the courses?If the answer is yes, put a checkmark on a checkbox.If they have not, put an X.How can I handle this?Thanks in advance |
|
|
M.E.
Aged Yak Warrior
539 Posts |
Posted - 2002-09-15 : 18:12:53
|
| Okay, I don't quite understand what you got here. I don't see anywhere in this layout that states who took what course. to get a list of employee names with the course they need to takeselect fname,lname,requiredCourse from courses inner join HR on HR.positionno = courses.positionnothis wiill state thier name and the required course. I am assuming it will be 1 hr record to many courses... so the output will look something likebob smith course101bob smith office typing skills 104bob smith sitting on butt 101phil meup course 101phil meup course 505something like that. As for the second part of your question, is there a location that states whether or not that person took the course? You may want to take a look at your table layout on this one man. It almost seems like you need a thrid table to track who takes what. Another point... You may need a fourth table to link up which employees need which courses (i guess the thrid one would work for this...).If you want send me an email and I'll help you set this up a little better. Although I'm really hoping it's not a home work assignment.And for your last question... SQL doesn't really provide anything that gives you nice check boxes if they are and x's if they aren't... You need to be using something like Access (unless theres some new graphical interface for queries now). I guess ASP could do it too. [edit] typo city.. damn-----------------------Take my advice, I dare yaEdited by - M.E. on 09/15/2002 18:16:49 |
 |
|
|
simflex
Constraint Violating Yak Guru
327 Posts |
Posted - 2002-09-15 : 19:11:36
|
Thanks M.E.I have just sent you an email.Thanks for your help!quote: Okay, I don't quite understand what you got here. I don't see anywhere in this layout that states who took what course. to get a list of employee names with the course they need to takeselect fname,lname,requiredCourse from courses inner join HR on HR.positionno = courses.positionnothis wiill state thier name and the required course. I am assuming it will be 1 hr record to many courses... so the output will look something likebob smith course101bob smith office typing skills 104bob smith sitting on butt 101phil meup course 101phil meup course 505something like that. As for the second part of your question, is there a location that states whether or not that person took the course? You may want to take a look at your table layout on this one man. It almost seems like you need a thrid table to track who takes what. Another point... You may need a fourth table to link up which employees need which courses (i guess the thrid one would work for this...).If you want send me an email and I'll help you set this up a little better. Although I'm really hoping it's not a home work assignment.And for your last question... SQL doesn't really provide anything that gives you nice check boxes if they are and x's if they aren't... You need to be using something like Access (unless theres some new graphical interface for queries now). I guess ASP could do it too. [edit] typo city.. damn-----------------------Take my advice, I dare yaEdited by - M.E. on 09/15/2002 18:16:49
|
 |
|
|
|
|
|
|
|