datetime_expression: Ein Feld oder Ausdruck vom Typ „Datum“ oder „Datum und Uhrzeit“.
integer: Ein Feld oder Ausdruck vom Typ „Ganzzahl“, das bzw. der die Anzahl von Teilen angibt, die abgezogen werden sollen.
part: Die Zeiteinheit, die abgezogen werden soll. DATETIME_ADD unterstützt die folgenden Werte für part:
MICROSECOND: Verfügbar für Felder und Ausdrücke vom Typ „Datum und Uhrzeit“.
MILLISECOND: Verfügbar für Felder und Ausdrücke vom Typ „Datum und Uhrzeit“.
SECOND: Verfügbar für Felder und Ausdrücke vom Typ „Datum und Uhrzeit“.
MINUTE: Verfügbar für Felder und Ausdrücke vom Typ „Datum und Uhrzeit“.
HOUR: Verfügbar für Felder und Ausdrücke vom Typ „Datum und Uhrzeit“.
DAY
WEEK: Dieser Datumsteil beginnt mit Sonntag.
ISOWEEK: Verwendet Wochengrenzen nach ISO 8601. ISO-Wochen beginnen mit Montag.
MONTH
QUARTER
YEAR
ISOYEAR: Verwendet die Jahresgrenze gemäß der ISO 8601-Wochennummerierung. Die ISO-Jahresgrenze ist der Montag der ersten Woche, in der der Donnerstag in das entsprechende gregorianische Kalenderjahr fällt.
Diese Funktion ist für Typen von Kompatibilitätsmodus-Daten nicht verfügbar.
MONTH, QUARTER und YEAR müssen speziell behandelt werden, wenn das Datum der letzte Tag des Monats ist oder in dessen Nähe liegt. Wenn der daraus resultierende Monat weniger Tage als der Tag des ursprünglichen Tages vom Typ „Datum“ oder „Datum und Uhrzeit“ hat, ist der Ergebnistag der letzte Tag des neuen Monats.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-07-30 (UTC)."],[],[],null,["DATETIME_SUB\n============\n\nSubtracts a specified time interval from a date.\n\nSample usage\n------------\n\n`DATETIME_SUB(Order Date, INTERVAL 1 WEEK)`\n\nSyntax\n------\n\n`DATETIME_SUB( `\u003cvar translate=\"no\"\u003edatetime_expression\u003c/var\u003e`, INTERVAL `\u003cvar translate=\"no\"\u003einteger\u003c/var\u003e` `\u003cvar translate=\"no\"\u003epart\u003c/var\u003e` )`\n\n### Parameters\n\n- \u003cvar translate=\"no\"\u003edatetime_expression\u003c/var\u003e - a Date or a Date \\& Time field or expression.\n- \u003cvar translate=\"no\"\u003einteger\u003c/var\u003e - a whole numeric field or expression representing the number of parts to subtract.\n- \u003cvar translate=\"no\"\u003epart\u003c/var\u003e - the unit of time measurement to subtract. DATETIME_ADD supports the following values for `part`:\n - `MICROSECOND`: available for Date \\& Time fields or expressions.\n - `MILLISECOND`: available for Date \\& Time fields or expressions.\n - `SECOND`: available for Date \\& Time fields or expressions.\n - `MINUTE`: available for Date \\& Time fields or expressions.\n - `HOUR`: available for Date \\& Time fields or expressions.\n - `DAY`\n - `WEEK`: This date part begins on Sunday.\n - `ISOWEEK`: Uses [ISO 8601 week](https://en.wikipedia.org/wiki/ISO_week_date) boundaries. ISO weeks begin on Monday.\n - `MONTH`\n - `QUARTER`\n - `YEAR`\n - `ISOYEAR`: Uses the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) week-numbering year boundary. The ISO year boundary is the Monday of the first week whose Thursday belongs to the corresponding Gregorian calendar year.\n\nReturn data type\n----------------\n\nDate \\& Time\n\nExamples\n--------\n\nNotes\n-----\n\nThis function is not available for compatibility mode date types.\n\nSpecial handling is required for `MONTH`, `QUARTER`, and `YEAR` parts when the date is at (or near) the last day of the month. If the resulting month has fewer days than the original Date or Date \\& Time's day, then the result day is the last day of the new month.\n\nRelated resources\n-----------------\n\n- [Dates and times](/looker/docs/studio/dates-and-times)\n- [Calculated fields](/looker/docs/studio/about-calculated-fields)\n- [Looker Studio function list](/looker/docs/studio/function-list)"]]