Hi,
I am creating a report and need to count the number of clients that are within the first 48 hours of the service, and also count clients that are above 48 hours. I also need to count clients whose service has ended, but count those that ended within 48 hours and those that ended after 48 hours.
The fields I have are:
service_start_date_time This is a long date and time field.
service_end_date_time This is a long date and time field.
package_accepted This is a tickbox to say whether a package was accepted or not.
minutes This is a caculated field in the query I am using for the report. Using Minutes: DateDiff("n",[service_start_date_time],IIf([service_end_date_time] Is Null,Date(),[service_end_date_time]))
hours this is a calculated field in the query I am using for the report. Using Hours: [Minutes]\60 & Format([Minutes] Mod 60,"\:00")
EDIT: I have added a field to the report called onservice which uses this: =IIf([service_end_date_time] Is Null And [package_accepted]=True,"Yes","No")
Thought it might help.
The four counts I need to do are:
1) Clients Still On Service Within First 48 Hours. Criteria for this is package_accepted is ticked, hours is less than 48 and service_end_date_time is blank EDIT: Instead of package_accepted true and service_end_date_time blank, you could use the new onservice field which states Yes or No if they are on service)
I've been trying this: =Sum(IIf([service_end_date_time] Is Null And [package_accepted]=True And [Hours]<48,1,0)) but it doesn't like that at all.
2) Clients Still On Service Beyond First 48 Hours. Criteria for this is package_accepted is ticked, hours is more than 48 and service_end_date_time is blank. EDIT: Instead of package_accepted true and service_end_date_time blank, you could use the new onservice field which states Yes or No if they are on service)
3) Clients Whose Service Ended Within First 48 Hours. Criteria for this is package_accepted is ticked, hours is less than 48 and service_end_date_time has a value in it. EDIT: Instead of package_accepted true and service_end_date_time , you could use the new onservice field which states Yes or No if they are on service)
3) Clients Whose Service Ended Beyond First 48 Hours. Criteria for this is package_accepted is ticked, hours is more than 48 and service_end_date_time has a value in it. EDIT: Instead of package_accepted true and service_end_date_time blank you could use the new onservice field which states Yes or No if they are on service)
I've tried loads of different SUM/IIF/AND/COUNT expressions, but I cannot seem to get it to work at all.
Any help you could give me would be amazing, because I'm up against a tight deadline and I've hit a brick wall.
I am creating a report and need to count the number of clients that are within the first 48 hours of the service, and also count clients that are above 48 hours. I also need to count clients whose service has ended, but count those that ended within 48 hours and those that ended after 48 hours.
The fields I have are:
service_start_date_time This is a long date and time field.
service_end_date_time This is a long date and time field.
package_accepted This is a tickbox to say whether a package was accepted or not.
minutes This is a caculated field in the query I am using for the report. Using Minutes: DateDiff("n",[service_start_date_time],IIf([service_end_date_time] Is Null,Date(),[service_end_date_time]))
hours this is a calculated field in the query I am using for the report. Using Hours: [Minutes]\60 & Format([Minutes] Mod 60,"\:00")
EDIT: I have added a field to the report called onservice which uses this: =IIf([service_end_date_time] Is Null And [package_accepted]=True,"Yes","No")
Thought it might help.
The four counts I need to do are:
1) Clients Still On Service Within First 48 Hours. Criteria for this is package_accepted is ticked, hours is less than 48 and service_end_date_time is blank EDIT: Instead of package_accepted true and service_end_date_time blank, you could use the new onservice field which states Yes or No if they are on service)
I've been trying this: =Sum(IIf([service_end_date_time] Is Null And [package_accepted]=True And [Hours]<48,1,0)) but it doesn't like that at all.
2) Clients Still On Service Beyond First 48 Hours. Criteria for this is package_accepted is ticked, hours is more than 48 and service_end_date_time is blank. EDIT: Instead of package_accepted true and service_end_date_time blank, you could use the new onservice field which states Yes or No if they are on service)
3) Clients Whose Service Ended Within First 48 Hours. Criteria for this is package_accepted is ticked, hours is less than 48 and service_end_date_time has a value in it. EDIT: Instead of package_accepted true and service_end_date_time , you could use the new onservice field which states Yes or No if they are on service)
3) Clients Whose Service Ended Beyond First 48 Hours. Criteria for this is package_accepted is ticked, hours is more than 48 and service_end_date_time has a value in it. EDIT: Instead of package_accepted true and service_end_date_time blank you could use the new onservice field which states Yes or No if they are on service)
I've tried loads of different SUM/IIF/AND/COUNT expressions, but I cannot seem to get it to work at all.
Any help you could give me would be amazing, because I'm up against a tight deadline and I've hit a brick wall.
Last edited: