BIRT, round up/append 59 seconds to date/time parameter?

48 Views Asked by At

Have a date/time field in this format in the database: 2018-12-10 15:45:00.075444

Have a parameter query that is searching between a beginning date and ending date. I do not want the user to have to enter the seconds part.

This is the format of what's being entered: 2023-02-17 23:59

BIRT seems to be appending :00 to the parameter for seconds. This is great for the beginning date, however I need the ending date to be appended with :59. :00 in this case would omit records from 0-59 seconds which is not desirable in this case.

I tried using JavaScript to edit the end date and append it but no success yet.

1

There are 1 best solutions below

2
hvb On

BIRT seems to be appending :00 to the parameter for seconds.

No, BIRT just interpretes the date/time correct. Of course the effect is the same.

I'd recommend to use half-open intervals for the beginnging and end dates. Eg. let the user enter 2023-02-18 00:00 and compare with date_column < :end_date instead of <=.