CurrentDate() function

Hi,

I have a report which has a column date, the values are from 1st of april to 30th of april.

(considering curent date is 19th April)

I use a define filter on the Date object.

=Date < currentDate()
The values selected are from 1st to current date (19th April)

is this how it works. it should rather select dates from 1st till 18th April.

Please suggest

Current Date() however works fine


shiky (BOB member since 2007-07-11)

CurrentDate() is an implied Date/Time object. You are getting information from the currentdate because there are transactions that have already happened. You will have to generically truncate the current date to filter correctly.

Have you tried:

=Date < toDate( formatdate(currentDate() ,“mm/dd/yyyyy”),“mm/dd/yyyy”)

By excluding the time portion during the formatting/conversion, you truncate it.


digpen :us: (BOB member since 2002-08-15)

Thanks ,

I did try the formatting option and it did work…

but wanted to know why does < currentdate() function work taht way


shiky (BOB member since 2007-07-11)

because CurrentDate() is a date/timestamp. Typically used for displaying report timestamp information in a report. Your other option is to build a filter in the data provider and base it off a database timestamp (pre-process vs. post-process).


digpen :us: (BOB member since 2002-08-15)

as said, currentdate is a date/timestamp.
example, currentdate() gives me now 20th april 08:03.
date 20th april, you don’t see the timestamp but BO considers this date as 20th april 00:00 which is inferior to the currentdate().


azertyh :madagascar: (BOB member since 2005-10-27)

Thanks a lot… It did help :lol:


shiky (BOB member since 2007-07-11)