Page 1 of 1

Results on query differ than what shows up on the report...DateTimePicker

Posted: Fri Aug 06, 2010 11:24 am
by pepito
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

Results on query differ than what shows up on the report...DateTimePicker

Posted: Sun Aug 08, 2010 6:05 am
by Brendan
Hi,

What is your code that passes the values of the Dates from the controls on the form to your Datasource for the query to run?

My guess is that the start date from your DateTimePicker is including a Time value and as a result is not picking up your record entry for the 08/02 because it has a Time value of 00:00 perhaps.


Results on query differ than what shows up on the report...DateTimePicker

Posted: Mon Aug 09, 2010 12:23 am
by Alex K.
Hello,

Please check what time in HH:SS do you have in the database and what is transferred from the DateTimePickerControl component.
Perhaps you have the same date but different time.

Thank you.

Results on query differ than what shows up on the report...DateTimePicker

Posted: Mon Aug 16, 2010 3:23 pm
by pepito
Thank you very much!!!! The DateTimePicker was including the time...that resolved the problem.

Thanks again,

Results on query differ than what shows up on the report...DateTimePicker

Posted: Mon Aug 16, 2010 10:32 pm
by Andrew
Great! Let us know if you need any additional help.

Thank you.