Denise2020
Member
- Local time
- Today, 17:24
- Joined
- Mar 31, 2020
- Messages
- 82
I have an interactive form that creates a report based on criteria input by the user.
The user can select a JobSource and a Date Range and the report shows how many hours in total were spent on the jobs that fit those criterion. The report is based on a query with criterion based on the JobSource and Dates inputted on the forms.
However, there is a checkbox on each job as to whether the job was done outside of normal work hours. I need to create a subtotal on the report
that shows the total number of hours spent just on those jobs outside of normal work hours. I am having a heck of a time figuring this out. I have tried a separate query and joining it to the original query to get the total, but then I just get the TOTAL number of hours spent outside normal working hours for ALL jobs (no JobSource or Date Range taken into consideration).
I tried writing a DSUM expression to take all criterion into consideration (JobSource, Yes/No on the checkbox, and Date Range), but it also gives the total for ALL jobs.
Google isn't helping me find an answer I can make work, including the ever-helpful (http://theaccessweb.com/general/gen0018.htm)
This is my crazy query expression. Am I going about this totally the wrong way? Thanks in advance!
UtanforArbTid: DSum("Tidsatgang","tblStodarenden","TidUtanforArbetstid= -1" And "Uppdragsstallare Like " & [Forms]![fStodarendenList]![cboFilterUppdragsstallare] AND "Arendedatum Between " & [Forms]![fStodarendenList]![txtStartDateT] & " and " & [Forms]![fStodarendenList]![txtEndDateT])
Disclaimer: I am self-taught, and poorly at that, so please go easy on me.
The user can select a JobSource and a Date Range and the report shows how many hours in total were spent on the jobs that fit those criterion. The report is based on a query with criterion based on the JobSource and Dates inputted on the forms.
However, there is a checkbox on each job as to whether the job was done outside of normal work hours. I need to create a subtotal on the report
that shows the total number of hours spent just on those jobs outside of normal work hours. I am having a heck of a time figuring this out. I have tried a separate query and joining it to the original query to get the total, but then I just get the TOTAL number of hours spent outside normal working hours for ALL jobs (no JobSource or Date Range taken into consideration).
I tried writing a DSUM expression to take all criterion into consideration (JobSource, Yes/No on the checkbox, and Date Range), but it also gives the total for ALL jobs.
Google isn't helping me find an answer I can make work, including the ever-helpful (http://theaccessweb.com/general/gen0018.htm)
This is my crazy query expression. Am I going about this totally the wrong way? Thanks in advance!
UtanforArbTid: DSum("Tidsatgang","tblStodarenden","TidUtanforArbetstid= -1" And "Uppdragsstallare Like " & [Forms]![fStodarendenList]![cboFilterUppdragsstallare] AND "Arendedatum Between " & [Forms]![fStodarendenList]![txtStartDateT] & " and " & [Forms]![fStodarendenList]![txtEndDateT])
Disclaimer: I am self-taught, and poorly at that, so please go easy on me.