ReportSQL - Pulling Activity record information into a Timekeeping Report

Your Timekeeping report is great, but you use Activity records and need to pull in the Action and Item from those records. So you add the Activity subtable to your report and realize it limits results to only timeslips linked to an Activity record.

Here are two expressions that don't require adding the Activity subtable. Both are text formula fields from the top level Timekeeping table.

For the Activity Action:

(
SELECT 
    lookup_activity_action.name 
FROM 
    activity 
JOIN 
    service ON service.id = activity.service 
JOIN 
    lookup_activity_action ON lookup_activity_action.id = activity.action_id
WHERE 
    activity.service = %tableAlias%.id
)

For the Activity Item:

(
SELECT 
    lookup_activity_item.name 
FROM 
    activity 
JOIN 
    service ON service.id = activity.service 
JOIN 
    lookup_activity_item ON lookup_activity_item.id = activity.item_id
WHERE 
    activity.service = %tableAlias%.id
)
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us