ISOYEAR: ISO 8601 주 번호 지정 연도 경계를 사용합니다. ISO 연도 경계는 목요일이 해당 그레고리력 연도에 속하는 첫 번째 주의 월요일입니다.
반환 데이터 유형
숫자 (정수)
예시
아래의 두 번째 및 세 번째 예는 24시간 떨어진 두 날짜 값의 DATETIME_DIFF 결과를 보여줍니다. 부분 WEEK가 있는 DATETIME_DIFF는 1을 반환합니다. DATETIME_DIFF가 이 날짜 값 범위에 있는 부분 경계의 수를 세기 때문입니다. 각 WEEK는 일요일에 시작하므로 2017-10-14 00:00:00 토요일과 2017-10-15 00:00:00 일요일 사이에는 하나의 부분 경계가 있습니다.
수식 예
출력
DATETIME_DIFF( DATETIME "2010-07-07 10:20:00", DATETIME "2008-12-25 15:30:00", DAY )
559
DATETIME_DIFF( DATETIME "2017-10-15 00:00:00", DATETIME "2017-10-14 00:00:00", DAY )
다음 예는 연도가 서로 다른 두 날짜의 DATETIME_DIFF 결과를 보여줍니다. 날짜 부분 YEAR가 있는 DATETIME_DIFF는 3을 반환하는데, 두 날짜 값 사이에 있는 그레고리력 연도 경계의 수를 세기 때문입니다. 날짜 부분 ISOYEAR가 있는 DATETIME_DIFF는 2를 반환하는데, 두 번째 날짜 값이 ISO 2015 연도에 속하기 때문입니다. 2015 달력 연도의 첫 번째 목요일은 2015-01-01이었으므로 ISO 2015 연도는 이전 월요일인 2014-12-29에 시작합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-31(UTC)"],[],[],null,["DATETIME_DIFF\n=============\n\nReturns the number of part boundaries between two dates.\n\nSample usage\n------------\n\n`DATETIME_DIFF(Order Date, Ship Date, DAY)`\n\nSyntax\n------\n\n`DATETIME_DIFF( `\u003cvar translate=\"no\"\u003edate_expression\u003c/var\u003e`, `\u003cvar translate=\"no\"\u003edate_expression\u003c/var\u003e`, `\u003cvar translate=\"no\"\u003epart\u003c/var\u003e` )`\n\n### Parameters\n\n- \u003cvar translate=\"no\"\u003edate_expression\u003c/var\u003e - a Date or a Date \\& Time field or expression. If the first date expression occurs before the second date expression, then the result is zero or negative.\n- \u003cvar translate=\"no\"\u003epart\u003c/var\u003e - the time part to return. `DATETIME_DIFF` supports the following parts:\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\nNumber (integer)\n\nExamples\n--------\n\nThe second and third example below show the result of `DATETIME_DIFF` for two date values that are 24 hours apart. `DATETIME_DIFF` with the part `WEEK` returns 1 because `DATETIME_DIFF` counts the number of part boundaries in this range of date values. Each `WEEK` begins on Sunday, so there is one part boundary between Saturday, 2017-10-14 00:00:00 and Sunday, 2017-10-15 00:00:00.\n\nThe following example shows the result of `DATETIME_DIFF` for two dates in different years. `DATETIME_DIFF` with the date part `YEAR` returns 3 because it counts the number of Gregorian calendar year boundaries between the two date values. `DATETIME_DIFF` with the date part `ISOYEAR` returns 2 because the second date value belongs to the ISO year 2015. The first Thursday of the 2015 calendar year was 2015-01-01, so the ISO year 2015 begins on the preceding Monday, 2014-12-29.\n\nThe following example shows the result of `DATETIME_DIFF` for two days in succession. The first date falls on a Monday and the second date falls on a Sunday. `DATETIME_DIFF` with the date part `ISOWEEK` also returns 1 because ISO weeks begin on Monday.\n\nNotes\n-----\n\nThis function is not available for compatibility mode date types.\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)"]]