I would like create a timestamp with the last day of a month. I have a prompt with the month and the year but for the day I dont know how generate the last day of the selected month.
I only have make_timestamp(?Year?,?Month?,) for now... What could I put for the third parameter ?
Just found it...
_make_timestamp ( ?year?,?Month?,_days_to_end_of_month (_make_timestamp ( ?year?,?Month?,0 )))
the '0' value in the make_timestamp returns that error :
UDA-SQL-0114 The cursor supplied to the operation "sqlOpenResult" is inactive. UDA-SQL-0564 [Microsoft OLE DB Provider for SQL Server]The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. (SQLSTATE=22007, SQLERRORCODE=242)
What could I use ?
Would the 1st day of the next month, minus 1 day work?
Quote_last_of_month ( date_exp )
Returns a date or datetime, depending on the argument, that is the last day of the month represented by "date_exp".
_last_of_month( _make_timestamp ( ?year?, ?Month?, 1 ) )
thanks !