Hi !
I know this is not straightly a PLC-Problem, but im trying to fetch data from WinCC-Database using SQL-statements and what i basicly need to do is :
I need to find out when the temperature of Burner has reached the optimal temperature to start the production during Monday mornings with a timescale of the whole last year, up to this point..
Im generating the week scale and extracting Mondays from it with a variable of 1 (The week scale is 1 to 7), 1 meaning as Monday, 7 as sunday, with a following query :
select created_date as DATE_AND_TIME, burner_temp as BURNER_TEMPERATURE, thermo_oil_inlet_temp as THERMON_OIL_TEMPERATURE,
extract(year from created_date) as YEAR
,extract(weekday from created_date) as DAY_OF_THE_WEEK
from selma_measure
where extract(weekday from created_date)= 1 and created_date>'01.01.2007' and burner_temp>738 order by created_date
The problem is that the result shows me every single result from every monday when temperature is 738 or higher. I need to get only the first time the temperature has reached 738 or higher & after that from the next Monday.
Does any of you guys have any idea how to do this ?
I know this is not straightly a PLC-Problem, but im trying to fetch data from WinCC-Database using SQL-statements and what i basicly need to do is :
I need to find out when the temperature of Burner has reached the optimal temperature to start the production during Monday mornings with a timescale of the whole last year, up to this point..
Im generating the week scale and extracting Mondays from it with a variable of 1 (The week scale is 1 to 7), 1 meaning as Monday, 7 as sunday, with a following query :
select created_date as DATE_AND_TIME, burner_temp as BURNER_TEMPERATURE, thermo_oil_inlet_temp as THERMON_OIL_TEMPERATURE,
extract(year from created_date) as YEAR
,extract(weekday from created_date) as DAY_OF_THE_WEEK
from selma_measure
where extract(weekday from created_date)= 1 and created_date>'01.01.2007' and burner_temp>738 order by created_date
The problem is that the result shows me every single result from every monday when temperature is 738 or higher. I need to get only the first time the temperature has reached 738 or higher & after that from the next Monday.
Does any of you guys have any idea how to do this ?