ช่วงวันที่
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ภาษาของคำค้นหาของ Google Ads ช่วยให้คุณระบุช่วงวันที่ได้ด้วยวิธีต่อไปนี้
กำหนดช่วงวันที่เอง
คุณระบุวันที่ในรูปแบบ ISO 8601 แบบขยาย
(YYYY-MM-DD
) หรือแบบพื้นฐาน (YYYYMMDD
) ได้ เช่น
segments.date BETWEEN '2024-01-01' AND '2024-01-31'
segments.date >= '20241001' AND segments.date <= '20241031'
ช่วงวันที่ที่กำหนดไว้ล่วงหน้า
รายการช่วงวันที่ที่กำหนดไว้ล่วงหน้าที่ถูกต้องมีดังนี้
ช่วงวันที่ |
ระบบจะสร้างรายงานสำหรับ... |
TODAY |
วันนี้เท่านั้น |
YESTERDAY |
เมื่อวานเท่านั้น |
LAST_7_DAYS |
7 วันที่ผ่านมาโดยไม่รวมวันนี้ |
LAST_BUSINESS_WEEK
|
สัปดาห์ทำการ 5 วัน ตั้งแต่วันจันทร์ถึงวันศุกร์ของสัปดาห์ทำการก่อนหน้า |
THIS_MONTH |
ทุกวันในเดือนปัจจุบัน |
LAST_MONTH |
ทุกวันในเดือนที่แล้ว |
LAST_14_DAYS |
14 วันที่ผ่านมาโดยไม่รวมวันนี้ |
LAST_30_DAYS |
30 วันที่ผ่านมาโดยไม่รวมวันนี้ |
THIS_WEEK_SUN_TODAY
|
ระยะเวลาระหว่างวันอาทิตย์ก่อนหน้ากับ
วันปัจจุบัน |
THIS_WEEK_MON_TODAY
|
ระยะเวลาระหว่างวันจันทร์ก่อนหน้ากับวันปัจจุบัน |
LAST_WEEK_SUN_SAT |
ระยะเวลา 7 วันโดยเริ่มตั้งแต่วันอาทิตย์ก่อนหน้า |
LAST_WEEK_MON_SUN |
ระยะเวลา 7 วันโดยเริ่มตั้งแต่วันจันทร์ก่อนหน้า |
ตัวอย่าง
segments.date DURING LAST_30_DAYS
ระยะเวลาที่กำหนดไว้ล่วงหน้า
ฟิลด์วันที่บางรายการอ้างอิงถึงระยะเวลาที่กำหนดไว้ล่วงหน้า ซึ่งได้แก่
segments.week
segments.month
segments.quarter
เมื่อกรองกลุ่มเหล่านี้ คุณสามารถใช้ตัวดำเนินการ =
กับวันที่
ซึ่งเป็นวันแรกของระยะเวลาได้ หากคุณระบุวันที่ที่ไม่ใช่วันแรกของช่วงเวลา ระบบจะแสดงข้อผิดพลาด MISALIGNED_DATE_FOR_FILTER
ตัวอย่างเช่น หากต้องการระบุเดือนพฤษภาคมในปี 2024 ให้ใช้เงื่อนไขต่อไปนี้โดยระบุวันแรกของเดือนนั้น
segments.month = '2024-05-01'
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-27 UTC
[null,null,["อัปเดตล่าสุด 2025-08-27 UTC"],[[["\u003cp\u003eGoogle Ads Query Language allows you to specify date ranges using custom dates, predefined date ranges like \u003ccode\u003eTODAY\u003c/code\u003e or \u003ccode\u003eLAST_30_DAYS\u003c/code\u003e, and predefined time periods for week, month, or quarter.\u003c/p\u003e\n"],["\u003cp\u003eCustom date ranges can be defined using ISO 8601 format, either extended (\u003ccode\u003eYYYY-MM-DD\u003c/code\u003e) or basic (\u003ccode\u003eYYYYMMDD\u003c/code\u003e), within a \u003ccode\u003eBETWEEN\u003c/code\u003e or \u003ccode\u003e>=\u003c/code\u003e and \u003ccode\u003e<=\u003c/code\u003e clause.\u003c/p\u003e\n"],["\u003cp\u003ePredefined date ranges provide shortcuts for common timeframes, such as \u003ccode\u003eLAST_BUSINESS_WEEK\u003c/code\u003e or \u003ccode\u003eTHIS_MONTH\u003c/code\u003e, simplifying date selection in queries.\u003c/p\u003e\n"],["\u003cp\u003eWhen filtering by predefined time periods (week, month, quarter), use the \u003ccode\u003e=\u003c/code\u003e operator with the first day of the period to avoid errors.\u003c/p\u003e\n"]]],[],null,["# Date Ranges\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nThe Google Ads Query Language lets you specify the date range in these ways:\n\n- [Custom date range](#custom)\n- [Predefined date range](#date-range)\n- [Predefined time period](#time-period)\n\nCustom date range\n-----------------\n\nYou can specify dates in [ISO 8601](//en.wikipedia.org/wiki/ISO_8601) extended\n(`YYYY-MM-DD`) or basic (`YYYYMMDD`) format, for example: \n\n segments.date BETWEEN '2024-01-01' AND '2024-01-31'\n\n segments.date \u003e= '20241001' AND segments.date \u003c= '20241031'\n\nPredefined date range\n---------------------\n\nThe list of valid predefined date ranges is as follows:\n\n| Date range | Reports are generated for... |\n|-----------------------|--------------------------------------------------------------------------------|\n| `TODAY` | Today only. |\n| `YESTERDAY` | Yesterday only. |\n| `LAST_7_DAYS` | The last 7 days not including today. |\n| `LAST_BUSINESS_WEEK` | The 5 day business week, Monday through Friday, of the previous business week. |\n| `THIS_MONTH` | All days in the current month. |\n| `LAST_MONTH` | All days in the previous month. |\n| `LAST_14_DAYS` | The last 14 days not including today. |\n| `LAST_30_DAYS` | The last 30 days not including today. |\n| `THIS_WEEK_SUN_TODAY` | The period between the previous Sunday and the current day. |\n| `THIS_WEEK_MON_TODAY` | The period between the previous Monday and the current day. |\n| `LAST_WEEK_SUN_SAT` | The 7-day period starting with the previous Sunday. |\n| `LAST_WEEK_MON_SUN` | The 7-day period starting with the previous Monday. |\n\nExample: \n\n segments.date DURING LAST_30_DAYS\n\nPredefined time period\n----------------------\n\nSome date fields refer to a predefined period of time, specifically:\n\n- `segments.week`\n- `segments.month`\n- `segments.quarter`\n\nWhen filtering on these segments, you can use the `=` operator with the date\nthat is the first day of the time period. If you specify a date that isn't the\nfirst day of a period, a `MISALIGNED_DATE_FOR_FILTER` error is returned.\n\nFor example, to specify the month of May in the year 2024, use the\nfollowing condition, specifying the first day of that month: \n\n segments.month = '2024-05-01'"]]