BlueIshDan
☠
- Local time
- Today, 14:27
- Joined
- May 15, 2014
- Messages
- 1,122
So i have developed an application that schedules lockout / kick times for maintenance / updates for our Access databases.
I have a query that collects the general duration each user is spending on each application, on each day. In my efforts to gather the information, I believe I may have went a bit overboard with the use of functions and what not.
I'm simply requesting for help in making this query work in a more elegant and maybe even more effective way.
qryActivity:
Tables:
Thank you kindly!
Dan
I have a query that collects the general duration each user is spending on each application, on each day. In my efforts to gather the information, I believe I may have went a bit overboard with the use of functions and what not.
I'm simply requesting for help in making this query work in a more elegant and maybe even more effective way.
qryActivity:
Code:
SELECT
Sum(IIf(IsNull([end]),Now(),[end])-[start]) AS general_duration,
DatePart("m",[activity].[start]) & "/" & DatePart("d",[activity].[start]) & "/" & DatePart("yyyy",[activity].[start]) AS [Day],
users_list.username & "_" & GetAppNameByID(activity.app_id) AS username
FROM
activity
INNER JOIN users_list
ON activity.user_id=users_list.id
GROUP BY
DatePart("m",[activity].[start]) & "/" & DatePart("d",[activity].[start]) & "/" & DatePart("yyyy",[activity].[start]),
users_list.username,
activity.app_id;
Tables:
Thank you kindly!
Dan