|
From performance standpoint, you're better of casting the DATE so it matchesup with your field's data type (NUMERIC(8,0)). Reason behind that is that
create function CvtDateToNumISO(indte date) returns numeric(8,0)
language SQL
not fenced
deterministic no external action
specific CvtDateToNumISO
returns null on null input
contains SQL
set option datfmt=*ISO
begin
return( ( year(inDte) * 10000) +
( month(inDte) * 100) +
( day(inDte) ) );
end;
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.