I am designing a form to show employees' salary information. I need the form to show salary for years 2007 - 2013 in addition to their other personal info.
The form should look like this:
Name Department Sub Department
2007 2008 2009 2010 2011 2012 2013
Salary x
Bonus y
Total x+y
Various stats:
Calls Stats 2013 [a] [c]
Marketing Stats 2013 [b] [d]
Sales Rank 2011 [x]
Sales Rank 2012 [y]
Sales Rank 2013 [z]
I have tried everything to get the years to work properly but to no avail. I have tried making one large query. I have tried making multiple queries and plugging them in.
My tables are:
- EmpTable
- CompensationTable
- DepartmentTable
- StatsTable
CompTable and StatsTable have a year column so each year has different salary/stats.
What are the steps to setting up a form like this? I have tried several things but none of them are working. I want it all to be on one page so I don't want to use split form unless I really have to.
EDIT: Schema:
EmpTable CompTable DeptTable StatsTable
PK CompID PK StatsID
PK ID ------>FK ID -----> PK/FK ID (From emp) ----> FK ID (From emp)
Name Year Dept Year
Etc. Salary Rank
Solutions I have tried:
- Making one large query with no normalization. For example it has columns for each year. Used to work but doesn't work now because I fixed normalization in my tables.
- Making one large query with multiple queries. Each individual query for each year. For example, 2013 Comp Query + 2012 Comp Query all into one big query. Doesn't work because too many fields. (more than 127)