# Subtraction operation

Learn how to subtract a value from another.

The subtraction operation calculates the difference between two numeric or temporal operands and returns the difference.

To use the subtraction operation, place a `-` sign between two numeric values:

```cql
/*<operand>*/ - /*<operand>*/
```

Alternatively, for a more natural language feel, you can write it as follows:

```cql
/*<operand>*/ minus /*<operand>*/
```

Here is a practical example:

```cql
5 - 3 // 2
```

For temporal values, the subtraction operation allows you to perform calculations involving dates, times, and [durations](/reference/cql/expressions/durations):

```cql
today - 1 day
```

The above example subtracts one day from the current date, resulting in the date of yesterday. You can chain multiple operations together to perform more complex calculations:

```cql
today - 1 month - 1 week
```

In contrast to addition, subtraction is not [commutative](https://en.wikipedia.org/wiki/Commutative_property). This means that you cannot subtract a date from a period of time, but you can subtract a period of time from a date. For example, `today - 1 day` works, but not `1 day - today`.

Finally, note that the subtraction operation does not perform any automatic conversions for temporal values. Be sure to use the [cast modifier](/reference/cql/expressions/modifiers/other/cast) to convert a value to a date or time before subtracting it from another value, as shown below:

```cql
"2021-01-01" as date - 1 day
```
