|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How do I get Access to automatically return a table value using 2 expression critera? I need the query to return the % that an employee is vested based on the years of service (03 SY matching Vesting Schedule Column) so I can use it in another calculation in another query.
Below is the revelant information that I am using in the query: SERVICE YEARS EE# (employee number) 04 SY (years of service for 2004 - calculated then transferred) 03 SY (ditto for 2003) EMPLOYEE EE# Last Name, first name, etc Sort Name 2003 ANNUAL REPORT Sort Name Vest Name VEST SCHEDULE Vest Name 1 (schedule of %'s based on Vest Name and 1 year of service) 2 (schedule of %'s based on Vest Name and 2 years of service) 3 4 5 6 7 8 9 10 (after 10 years the EE is 100% vested) RELATIONSHIPS Service Years linked to Employees via EE# Employees linked to 2003 Annual Report through Sort Name 2003 AR linked to Vesting Schedule through Sort Name I need the query to return the % that an employee is vested based on the years of service (03 SY matching Vesting Schedule Column) so I can use it in another calculation in another query. When I do this in Excel I use the VLookup and Match combined where the Match returns the column number and the VLookup then returns the %. I'm sure this is possible in Access, but can't figure it out. I'm not new to Access, but haven't used it in a few years and am a bit rusty. |
|
#2
|
|||
|
|||
|
Would DLookup do what you need?
|
|
#3
|
|||
|
|||
|
DLookup won't really work in this case because the VEST SCHEDULE table is not normazlied. I didn't set up this database, so I had no control over that.
I also posted on another website that already answered by question. Nothing else was linked to that table, so I redid it in a nomalized fashion then the DLookup worked. As a temporary work around I did a long IFF statement to go with each year. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Access 2000 Define Variable Field Lookup |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|