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

Stimulsoft Reports.NET discussion
Post Reply
pepito
Posts: 2
Joined: Fri Aug 06, 2010 11:12 am
Location: NJ

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

Post 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
Attachments
528.Sample.doc
(261.5 KiB) Downloaded 236 times
Brendan
Posts: 309
Joined: Sun Jul 16, 2006 12:42 pm
Location: Ireland

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

Post 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.

Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

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

Post 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.
pepito
Posts: 2
Joined: Fri Aug 06, 2010 11:12 am
Location: NJ

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

Post by pepito »

Thank you very much!!!! The DateTimePicker was including the time...that resolved the problem.

Thanks again,
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

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

Post by Andrew »

Great! Let us know if you need any additional help.

Thank you.
Post Reply