Results on query differ than what shows up on the report...DateTimePicker
Posted: Fri Aug 06, 2010 11:24 am
Good day,
I'm new to this tool and have tried everything that i know to resolve a problem with no luck. Hopefully someone can help.
I have 2 datetimepickercontrols on a form, start date and end date. These 2 variables produce the correct date when the query is executed, however, the report produces different results.
For example the minPosdate is 08/02/2010 and maxPosdate is 08/05/2010. This should bring 4 records onto the report, 8/2, 8/3, 8/4 and 8/5. The query results show all 4 records but the report begins with 08/03/2010, 8/4/2010 and 08/05/2010. The entire record for the first date or start date is completely ignored/missing.
Any ideas? Thank you!!!
select v.testobjectident,name,positiondate,count(1) as allresults,
sum(decode(v.severityident, 0, 1, 0)) as breaches,
sum(decode(v.severityident, 0, decode(v.number_of_days, 1, 1, 0), 0)) as new_breaches,
sum(decode(v.severityident, 0, decode(v.number_of_days, 1, 0, 1), 0)) as ongoing,
sum(decode(v.severityident, 1, 1, 0)) as warnings,
sum(decode(v.severityident, 2, 1, 0)) as errors,
sum(decode(v.severityident, 3, 1, 0)) as infos,
sum(decode(v.severityident, 5, 1, 0)) as oks
from violation v,poscheck p,testobject t
where flag_deletion=0 and v.checkident=P.CHECKIDENT and v.testobjectident=t.testobjectident
and v.testobjectident = :tbj
and positiondate>=to_date(:minposdate,'MM/DD/YYYY HH24:MI:SS')
and positiondate<=to_date(:maxposdate,'MM/DD/YYYY HH24:MI:SS')
group by v.testobjectident,name,positiondate
order by v.testobjectident,positiondate
I'm new to this tool and have tried everything that i know to resolve a problem with no luck. Hopefully someone can help.
I have 2 datetimepickercontrols on a form, start date and end date. These 2 variables produce the correct date when the query is executed, however, the report produces different results.
For example the minPosdate is 08/02/2010 and maxPosdate is 08/05/2010. This should bring 4 records onto the report, 8/2, 8/3, 8/4 and 8/5. The query results show all 4 records but the report begins with 08/03/2010, 8/4/2010 and 08/05/2010. The entire record for the first date or start date is completely ignored/missing.
Any ideas? Thank you!!!
select v.testobjectident,name,positiondate,count(1) as allresults,
sum(decode(v.severityident, 0, 1, 0)) as breaches,
sum(decode(v.severityident, 0, decode(v.number_of_days, 1, 1, 0), 0)) as new_breaches,
sum(decode(v.severityident, 0, decode(v.number_of_days, 1, 0, 1), 0)) as ongoing,
sum(decode(v.severityident, 1, 1, 0)) as warnings,
sum(decode(v.severityident, 2, 1, 0)) as errors,
sum(decode(v.severityident, 3, 1, 0)) as infos,
sum(decode(v.severityident, 5, 1, 0)) as oks
from violation v,poscheck p,testobject t
where flag_deletion=0 and v.checkident=P.CHECKIDENT and v.testobjectident=t.testobjectident
and v.testobjectident = :tbj
and positiondate>=to_date(:minposdate,'MM/DD/YYYY HH24:MI:SS')
and positiondate<=to_date(:maxposdate,'MM/DD/YYYY HH24:MI:SS')
group by v.testobjectident,name,positiondate
order by v.testobjectident,positiondate