# Write a SOQL query that lists tomorrow's scheduled Service Appointments with the technician name for each.

**Topic:** Field Service · **Difficulty:** Medium · **Tags:** SOQL, Assigned Resource, Service Appointment

Read it on the site: https://www.forcechallenges.com/interview-questions/write-a-soql-query-that-lists-tomorrow-s-scheduled-service-appointments-with-the-technician-name-for-each

## Answer

Query from **Assigned Resource**, which links appointments and technicians, and read the parent fields through relationships.

```soql
SELECT ServiceAppointment.AppointmentNumber,
       ServiceAppointment.SchedStartTime,
       ServiceAppointment.SchedEndTime,
       ServiceResource.Name
FROM AssignedResource
WHERE ServiceAppointment.SchedStartTime = TOMORROW
ORDER BY ServiceResource.Name, ServiceAppointment.SchedStartTime
```

**Why this shape**
- One row per appointment and technician, so crews and multi-resource jobs appear correctly.
- `TOMORROW` is a date literal that works on date/time fields.
- Parent fields are read with dot notation.

---
Source: ForceChallenges · last updated 2026-10-28
