# Filter By Date Parts or Date Field

To filter by a date part, use the `WHERE` clause with the `EXTRACT()` function, and pass it the desired date parts (year, month, or day). To filter by a date field, use the `WHERE` clause with a logical operator.

This example filters by year.

```nolang
SELECT CloseDate
FROM "OpportunityFiscalEMTimezoned"
WHERE EXTRACT(YEAR FROM CloseDate) = 2014;
```

| CloseDate           |
| ------------------- |
| 2014-12-31 15:00:00 |
| 2014-12-30 16:00:00 |

This example returns CloseDate fields that occur on or before the given timestamp.

```nolang
SELECT CloseDate
FROM "OpportunityFiscalEMTimezoned"
WHERE CloseDate <= TIMESTAMP '2014-12-31 15:00:00';

```

| CloseDate           |
| ------------------- |
| 2014-12-30 16:00:00 |
