I have a SQL Server data source named [dbo].[tmtrak_dev_records] with the field 'activityHours'. I'd like to display the result of the following query as a Label:
SELECT SUM(activityHours)
FROM dbo.tmtrak_dev_records
WHERE activityDate = '2021-02-22' AND submittedBy = 'user@email.com'
Where the activityDate value is the result of:
Today() - (Weekday(Today(), StartOfWeek.Monday) - 1)
and the submittedBy value is the result of:
User().Email
We intend to use this PowerApp as a Time-Tracking tool for our department. This query result would display how many hours a user has logged for for each day of the week (Monday in this example).
I'm struggling however with getting this to work, and figuring out if it can be done at all. I have tried various things unsuccessfully, and am just hitting a wall with this.
Any help is greatly appreciated.