louiethebrain
Programmer
Hi I’ve been stumped on how to use the substring
In my subqry but i am a little stumped
Could someone lend a hand and explain the
Err in my ways please..
select tagname, padname = 1, datetime, (select value from analoghistory where tagname = 'tata' + substring(a.tagname, 6, 2) + 'lastpart'
and datetime = a.datetime) as value
from DiscreteHistory a
where tagname in ('Tag name here')
and datetime >= {ts '2017-11-01 07:45:00'}
and datetime <= {ts '2017-11-10 15:48:00'}
and wwresolution = 60000
and value = 1
order by tagname, datetime
Thanks
In my subqry but i am a little stumped
Could someone lend a hand and explain the
Err in my ways please..
select tagname, padname = 1, datetime, (select value from analoghistory where tagname = 'tata' + substring(a.tagname, 6, 2) + 'lastpart'
and datetime = a.datetime) as value
from DiscreteHistory a
where tagname in ('Tag name here')
and datetime >= {ts '2017-11-01 07:45:00'}
and datetime <= {ts '2017-11-10 15:48:00'}
and wwresolution = 60000
and value = 1
order by tagname, datetime
Thanks