last_day1
The last_day1 function is used to return the last day of the month containing date, truncated to the day, with the hour, minute, and second portion set to 00:00:00.
Similar function: last_day. The last_day function returns the last day of the month containing date. The return value format is yyyy-mm-dd.
Syntax
last_day1(string date)
Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| date | Yes | DATE or STRING | The date to be processed. Formats:
|
Return Values
Returns a date value of type STRING, in the format yyyy-mm-dd hh:mi:ss.
- If date is not of type DATE or STRING, an error is returned with the message "data type mismatch".
- If date is of type DATE or STRING but does not conform to the input format for date values, NULL is returned.
- If the date value is NULL, NULL is returned.
Example Code
- Returns 2023-08-31.
select last_day1('2023-08-10'); - Returns 2023-08-31 00:00:00.
select last_day1('2023-08-10 10:54:00'); - Returns NULL.
select last_day1(null);
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot