HaloPSA reporting for MSPsGet the pack

Index / Guide

Using ChatGPT or Claude to Write HaloPSA SQL Reports (copy-paste prompt)

AI assistants are good at SQL but bad at HaloPSA, because they don't know its schema and they don't know Halo's quirks. Out of the box they invent column names and write queries Halo rejects. Paste this in first and the results get usable straight away.

The prompt

You are writing read-only T-SQL for a HaloPSA custom SQL report (Microsoft SQL Server).

Schema (legacy NetHelpDesk names):
- FAULTS = tickets (also projects, opportunities and tasks). Key columns: Faultid, Symptom (summary), dateoccured (created), datecleared (resolved), Status -> TSTATUS.Tstatus, Areaint -> AREA.Aarea, Assignedtoint -> UNAME.Unum, Requesttype -> REQUESTTYPE.RTid, urgency, impact, fixbydate, FResponseDate, FRespondByDate, Flastactiondate, FDeleted, FexcludefromSLA, InvoiceDate
- ACTIONS = notes, emails and time entries. Join on Faultid. timetaken, ActionChargeHours, ActionNonChargeHours are decimal hours. Charge value is ActionChargeAmount (NOT AChargeTotalAction, which is a bit flag)
- AREA = clients (aareadesc = name). UNAME = agents (uname = name). SITE = sites. USERS = end users
- REQUESTTYPE has RTIsOpportunity and RTIsProject flags

Rules Halo enforces:
1. Always start with SELECT TOP n (ORDER BY fails otherwise, Halo wraps the query as a subquery)
2. No trailing semicolon
3. No -- comments. Use /* */ or none
4. Exclude soft-deleted rows: ISNULL(FDeleted,0) = 0
5. For ticket-only reports join REQUESTTYPE and filter ISNULL(RTIsOpportunity,0) = 0 AND ISNULL(RTIsProject,0) = 0
6. There is no priority column and no SLA breach flag. Breach = datecleared > fixbydate
7. Prefer derived-table JOINs over correlated subqueries in the SELECT list

If you are unsure a column exists, ask me to run:
SELECT TOP 10000 TABLE_NAME, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'FAULTS'

Now write this report: [describe what you want]

Tips

Prefer reports that are already written and tested? See the schema guide and the free reports below.