Forum Discussion
rpmrmartin
Aug 19, 2021Copper Contributor
Add a TRY_DATEADD function to handle overflows
I would like to return a default value if DATEADD overflows. Currently, the only way to handle DATEADD overflows/underflows is with a TRY/CATCH block. TRY/CATCH is not allowed in user-defined functions, so if there is an overflow, I have to resort to a cursor to find the rows that overflowed and replace DATEADD with a default value. If there was a TRY_DATEADD function, this could be done with a set-based approach that would require less code and perform better.
No RepliesBe the first to reply