|
Note that the CHAR scalar\cast function allows a second parameter to
map a date to character in the ISO form [for example] similarly to allow
the smaller or larger dates to avoid the date underflow and date
overflow conditions. So in the interface used to test the UDF, instead
of finding the session attribute to set date formats to ISO, use instead
the following UDF invocation:
CHAR( DISPLAYDAT( xxx ) , ISO )
instead of:
DISPLAYDAT( xxx )
Sometimes my preference would be to return CAST(NULL AS DATE) for an
input of zero, or in response to an error for any bad inputs like
20010229 or 99999999. In that case adding a HANDLER to the SQL function
to directly RETURN that, or return the DATE variable when that can be
set without an error.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.