# Write a SOQL query to fetch all Contacts whose Birthdate is in the Current Calendar Month (WHERE CALENDAR_MONTH(Birthdate) = 10).

**Topic:** Development · **Difficulty:** Medium · **Asked at:** Infosys, Persistent, Nagarro · **Tags:** soql, scenario, date-functions

Read it on the site: https://www.forcechallenges.com/interview-questions/write-a-soql-query-to-fetch-all-contacts-whose-birthdate-is-in-the-current-calendar-month-where-calendar

## Answer

Use the `CALENDAR_MONTH()` date function in the WHERE clause. In Apex, bind the current month instead of hardcoding it.

```soql
SELECT Id, Name, Birthdate FROM Contact WHERE CALENDAR_MONTH(Birthdate) = 10
```
```apex
Integer m = Date.today().month();
List<Contact> cs = [SELECT Id, Name FROM Contact WHERE CALENDAR_MONTH(Birthdate) = :m];
```

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