> ## Documentation Index
> Fetch the complete documentation index at: https://www.integrate.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ETL: ISOSubtractDuration

> Subtract an ISO 8601 duration from a datetime string and return the result. Use ISOSUBTRACTDURATION for date calculations in ETL data pipelines.

## Description

Substracts the value represented by the duration expression from the datetime\_string.

## Syntax

`ISOSubtractDuration(datetime_string, duration)`

## Arguments

*datetime\_string* - string expression in ISO 8601 format.

*duration* - duration string in ISO 8601 format. See [https://en.wikipedia.org/wiki/ISO\_8601#Durations](https://en.wikipedia.org/wiki/ISO_8601#Durations)

## Examples

`ISOSubtractDuration('2007-03-05T03:05:03.000Z', 'P1D')` returns 2007-03-04T03:05:03.000Z

## Notes

The datetime\_string must be in ISO 8601 date time format, otherwise the job will fail.

## Return value datatype

String

## Impact of null value

If input is null, returns null.
