Rob,
I'm not using IBM i Access Client Solutions.
From a IBM I Access for Windows command line.
STRSQL.
Pasted your SQL from the attachemnet.
Token <END-OF-STATEMENT> was not valid. Valid tokens: ( SELECT VALUE
Paul
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Rob Berendt
Sent: Thursday, April 27, 2017 9:48 AM
To: Midrange Systems Technical Discussion
Subject: RE: Need to find job start, job end, calculate total job time for a group of users, TST*, for a selected date range
I tried to use 7.1 functions only. Did you use the .sql file I sent you BCC and use that in the new IBM i Access Client Solutions Run SQL Scripts?
A little clue as to what particular error you are seeing might help.
Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600 Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com
From: "Steinmetz, Paul" <PSteinmetz@xxxxxxxxxx>
To: "'Rob Berendt'" <rob@xxxxxxxxx>, "'Midrange Systems Technical
Discussion'" <midrange-l@xxxxxxxxxxxx>
Date: 04/27/2017 09:31 AM
Subject: RE: Need to find job start, job end, calculate total
job time for a group of users, TST*, for a selected date range
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>
Rob,
Any reason why the below SQL might fail syntax checking on a V7R1 LPAR?
Thanks
Paul
From: Rob Berendt [mailto:rob@xxxxxxxxx]
Sent: Wednesday, April 26, 2017 2:04 PM
To: Midrange Systems Technical Discussion
Subject: Re: Need to find job start, job end, calculate total job time for
a group of users, TST*, for a selected date range
With T1 as (
Select timestamp_format(substr(FLASTR,69,8) concat ' ' concat
substr(FLASTR,81,8), 'MM/DD/YY HH24:MI:SS') as Start_timestamp,
substr(flastr, 38, 8) as Job_User, substr(flastr, 47, 10) as Job_name,
substr(flastr, 31, 26) as FQ_Job_name
from rob.flastr
where substr(flastr, 38, 8) = 'MIMIXOWN' and substr(flastr, 47, 10) =
'RCV_RUNCMD')
, T2 as (
Select timestamp_format(substr(FLAEND,67,8) concat ' ' concat
substr(FLAEND,79,8), 'MM/DD/YY HH24:MI:SS') as End_timestamp,
substr(flaend, 38, 8) as Job_User, substr(flaend, 47, 10) as Job_name,
substr(flaend, 31, 26) as FQ_Job_name
from rob.flaend
where substr(flaend, 38, 8) = 'MIMIXOWN' and substr(flaend, 47, 10) =
'RCV_RUNCMD')
select t1.FQ_Job_name, t1.Job_User, t1.Job_name, t1.Start_timestamp,
t2.End_timestamp,
t2.End_timestamp - t1.Start_timestamp as Job_duration
from t1 left outer join t2 on (t1.FQ_Job_name = t2.FQ_Job_name)
order by 6 desc;
[cid:image001.gif@01D2BF38.FB598EF0]
Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1
Group Dekko
Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com<
http://www.dekko.com/>
As an Amazon Associate we earn from qualifying purchases.