How can i displays the last buisness day data on to the rep

Hi Every one

I have one crystal report in that i should have to display the data based on one conditions like.

One Coloum should be display the data Up to Last business day data.

( Ex : If i run the report on Monday it should have to display the data up to last firday ( Becuse last friday was the last business day)).

So how can i do this in crystal reports , here we are using DB2.

Already i wrote one Condition like Current DATE - 1.

But if i run that report on Monday it wont be displays any data because “Current DATE - 1” is Sunday so there is no transactions on sunday, but as per my requirement it i suppose to display the Fridays data. Because friday was the last working day/Business Day.

How can i do this please guide me and thanks in advance

Thanks
Harika


harika.bo (BOB member since 2010-03-17)

[Moderator Note: Moving from Desktop Intelligence forum to Crystal XI]


Marek Chladny :slovakia: (BOB member since 2003-11-27)

Hi,

You can use the following for the record selection:

if DayOfWeek(CurrentDate)=2 then {Filed}=CurrentDate-3 else {Field}=CurrentDate-1

1 means sunday, 2 means monday and so on.

Cheers!!!
Manish


cr_manish :india: (BOB member since 2009-07-30)

You will have to account for Sunday as well, just in case the report is run.

if DayOfWeek(CurrentDate) = 1 then {Filed} = CurrentDate - 2
else
if DayOfWeek(CurrentDate) = 2 then {Filed} = CurrentDate - 3
else {Field} = CurrentDate - 1


Sanjay Kodidine :us: (BOB member since 2008-03-19)

thanks a lot


harika.bo (BOB member since 2010-03-17)

thanks a lot


harika.bo (BOB member since 2010-03-17)