Hello all, So I decided to start a new thread since my problem is very different then what it was. In the project I'm working on I have one query that gets all the actions I need and then I have a crosstab query that is used in a form and a report.
I am getting all the actions for all the weeks that I need, but I can't seem to get them sorted properly. This is what my boss is asking for.
-For the first two weeks, sort by index
-Each week after that the action need to added to the bottom of the list as they are chosen per week.
-If an action is swapped and added back on later the "X" will just fit in wherever the action was used first.
I attached an example I made in excel that might help get my point across. I also have a google drive link to my database, it's too big to upload on this site.
If anyone can be of some help it would greatly be appreciated. I need to have this part of my project done by Friday. I never used the crosstab query before, this is all new to me. June7 has been a great help with all of this so far.
If using the database and want to see what it looks like now. When you open the database, Hit "Enter", "History/Reports", Select "Thomas Deiter" and "Next".
Query1
SELECT UserID, FullName, WeekNumber, StandardAction, "X" AS Idx, Index
FROM Weekly_Challenges
WHERE Weekly_Challenges.StandardAction<>"Basic Action" AND Weekly_Challenges.StandardAction<>"Basic Action - Medical"
UNION SELECT UserID, Fullname, WeekNumber, StartTimeAction, "X" , Index
FROM Weekly_StartTime_Challenges
WHERE Index < 200;
SELECT UserID, FullName, WeekNumber, StandardAction, "X" AS Idx, Index
FROM Weekly_Challenges
WHERE Weekly_Challenges.StandardAction<>"Basic Action" AND Weekly_Challenges.StandardAction<>"Basic Action - Medical"
UNION SELECT UserID, Fullname, WeekNumber, StartTimeAction, "X" , Index
FROM Weekly_StartTime_Challenges
WHERE Index < 200;
Query1_crosstab
PARAMETERS [TempVars]![TmpUserID] Long;
TRANSFORM First(Query1.Idx) AS FirstOfIdx
SELECT Query1.UserID, Query1.StandardAction
FROM Query1
WHERE (((Query1.UserID)=[TempVars]![TmpUserID]))
GROUP BY Query1.UserID, Query1.StandardAction
ORDER BY Query1.WeekNumber
PIVOT Query1.WeekNumber IN (1,2,3,4,5,6,7,8,9,10,11,12);
PARAMETERS [TempVars]![TmpUserID] Long;
TRANSFORM First(Query1.Idx) AS FirstOfIdx
SELECT Query1.UserID, Query1.StandardAction
FROM Query1
WHERE (((Query1.UserID)=[TempVars]![TmpUserID]))
GROUP BY Query1.UserID, Query1.StandardAction
ORDER BY Query1.WeekNumber
PIVOT Query1.WeekNumber IN (1,2,3,4,5,6,7,8,9,10,11,12);
I am getting all the actions for all the weeks that I need, but I can't seem to get them sorted properly. This is what my boss is asking for.
-For the first two weeks, sort by index
-Each week after that the action need to added to the bottom of the list as they are chosen per week.
-If an action is swapped and added back on later the "X" will just fit in wherever the action was used first.
I attached an example I made in excel that might help get my point across. I also have a google drive link to my database, it's too big to upload on this site.
If anyone can be of some help it would greatly be appreciated. I need to have this part of my project done by Friday. I never used the crosstab query before, this is all new to me. June7 has been a great help with all of this so far.
If using the database and want to see what it looks like now. When you open the database, Hit "Enter", "History/Reports", Select "Thomas Deiter" and "Next".