I am working on a project (using Access as backend database, front end is Visual Studio application), first, I am not sure if I should do it in Access or Visual Studio. It is complicated for me, let me explain as clearly as I can.
I have three Access tables: Employee, Team, WorkingHours
Table Employee: Username is unique
Table Team: Every employee can belong to multiple teams.
Table WorkingHours: It records how many hours each employee has worked for the company. So maximum one record per employee per day. Assume they are all part-time employee. It is totally possible that an employee does not work during certain days.
Front end application: It has ComboBox for Team. For example, user select team1 from the dropdown list. I want to display last 7 days of data for team1, by employee & by date
So I want the program to do below things:
- Create field names: First 3 fields are same as table Employee fields(these 3 fields are not transpose), the last 7 fields are the last 7 days. it is even better to include Sun/Mon/Tue...., something like this: Username FirstName LastName 12/27/2020(Sun) 12/28/2020(Mon) 12/29/2020(Tue) 12/30/2020(Wed) 12/31/2020(Thu) 1/1/2021(Fri) 1/2/2021(Sat)
- I really want to have dates as field name in the displayed table, which makes project become complicated, at least too complicated for me. It can be fixed number of days, such as 7 days in this example, but it needs to be dynamic, it is 7 days before Now(). So 10 field names should be like this(it is better to add Sun/Mon/Tue ... to the field name): Username, FirstName, LastName, Now()-7, Now()-6, Now()-5, Now()-4, Now()-3, Now()-2, Now()-1
- Now program should fill out first 3 fields based on table Teams information.
- Then program looks into table WorkingHours and fill out remaining 7 fields. The output result should be something like the screenshot.
Now the question is: The output table should be displayed in front end application DataGridView, so should I make a query inside Access first (the query will show output table format), then front end application just needs to run the query and display the data in DataGridView? I feel like it is easier to set up the query in Access, then front end application just needs to run the query. But it is also too complicated for me to set up such kind of query.
Any comments? Any suggestions?
Thanks.