|
I'm trying to debug a colleagues SQL statement, and when I put it into
Visual Explain, I'm getting an error that TIMESTAMPDIFF can't be
found. I'm also getting errors that the date format identifier
(yyyymmdd) is not in any of the tables. Is there a format identifier
on the date function? I'm playing around with the statement, removing
and adding to see if I can get it to work. Here's the original SQL
statement:
SELECT date( POSEVTP.EVDATE, yyyymmdd ) AS EVDATE,
XMSTNO,
XMINNO,
XMINVT,
POSEVTP.EVUSER,
POSEVTP.EVBEFR,
POSEVTP.EVAFTR,
POSEVTP_1.EVAFTR AS EVAFTR_1,
POSEVTP_1.EVUSER AS EVUSER_1,
TIMESTAMP( date( POSEVTP.EVDATE, yyyymmdd ), substr( digits(
POSEVTP.EVTIME ), 1, 2 ) || ':' || substr( digits( POSEVTP.EVTIME ),
3, 2 ) || ':' || substr( digits( POSEVTP.EVTIME ), 5, 2 ) ) AS
COLUMN0003,
TIMESTAMP( date( POSEVTP_1.EVDATE, yyyymmdd ), substr( digits(
POSEVTP_1.EVTIME ), 1, 2 ) || ':' || substr( digits( POSEVTP_1.EVTIME
), 3, 2 ) || ':' || substr( digits( POSEVTP_1.EVTIME ), 5, 2 ) ) AS
COLUMN0002,
FLOAT( TIMESTAMPDIFF( SQL_TSI_SECOND, ( TIMESTAMP( date(
POSEVTP_1.EVDATE, yyyymmdd ), substr( digits( POSEVTP_1.EVTIME ), 1, 2
) || ':' || substr( digits( POSEVTP_1.EVTIME ), 3, 2 ) || ':' ||
substr( digits( POSEVTP_1.EVTIME ), 5, 2 ) ) ), ( TIMESTAMP( date(
POSEVTP.EVDATE, yyyymmdd ), substr( digits( POSEVTP.EVTIME ), 1, 2 )
|| ':' || substr( digits( POSEVTP.EVTIME ), 3, 2 ) || ':' || substr(
digits( POSEVTP.EVTIME ), 5, 2 ) ) ) ) ) / FLOAT( 60 ) AS COLUMN0005,
XMRETL
FROM
NEWSYS.POSEVTP POSEVTP, NEWSYS.POSMSTP POSMSTP, NEWSYS.POSEVTP POSEVTP_1
WHERE
POSEVTP.EVTRAN=POSMSTP.XMTRAN AND
POSEVTP.EVTRAN=POSEVTP_1.EVTRAN AND
POSEVTP.EVAFTR=POSEVTP_1.EVBEFR AND
( POSEVTP_1.EVAFTR = 'I' AND POSEVTP.EVDATE = 20041219 )
Any help appreciated. Thanks!
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.