× 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.



I manipulated your result and created a function:
CREATE OR REPLACE FUNCTION rob.ts8601 (
timestampIn timestamp
)
RETURNS char(25)
LANGUAGE SQL
BEGIN
DECLARE chartimestamp char(19);
declare timestampout char(25);
set chartimestamp = left(char(timestampIn), 19);
set timestampout = left(chartimestamp, 10)
CONCAT 'T' CONCAT REPLACE(SUBSTR(chartimestamp, 12, 8), ':', '.')
CONCAT (CASE WHEN CURRENT timezone < 0 THEN '-' ELSE '+' END)
CONCAT SUBSTR(DIGITS(CURRENT TIMEZONE), 1, 2) CONCAT ':' CONCAT SUBSTR(DIGITS(CURRENT TIMEZONE), 3, 2)
;
RETURN timestampout;
END;

You can paste the above into Run SQL Scripts and it will work.

Now you can use it like this:
values rob.ts8601(current timestamp);

Or like this
Select ColA, ColB, rob.ts8601(ColC)
From mytable;

Now if I could only get Alan Campin to add it to iDate...

Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.