× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Everyone:

I have created my first SQL user defined function (UDF)!

This UDF coverts a timestamp, including today's date, into a dec(8,0) so that you can compare it to BPCS or LX dates.

Then, you can (for example) change expired lots to status E.

Here is the code...

create function MyObjLib/yyyymmdd(TS timestamp)
returns dec(8,0)
language sql
begin
return cast(rtrim(char(year(TS)))||substr( digits (month(TS)),9)
||substr( digits (day(TS)),9) as dec(8,0));
end


update iln set lmrb='E' where lexdt > 0 and lexdt < MyObjLib/yyyymmdd(current timestamp) and lmrb in('A','C','Q')


What do you think?

Best Regards,

Peter

[cid:image001.png@01D11BAE.99FA4430]

Peter Lunde, BASc, MBA
Manager, Information Technology
WellSpring Pharmaceutical Canada Corp.
400 Iroquois Shore Rd
Oakville, ON, L6H 1M5
plunde@xxxxxxxxxxxxxxxxxx<mailto:plunde@xxxxxxxxxxxxxxxxxx>
We Believe in the Power of Our Chemistry.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.