简体   繁体   中英

Getting Max and Min Values in Crystal Report Formula

I am Using Crystal Report with VS 2012 with Dataset and Populating the Report with Run Time. I am getting Repetitive rows for My Report, It is because the Data is Entered with Different Period (Month/Year) like the salary of Person for Month and Year. So What I thought to get rid of the Repetition of rows is I am going to Get the Values of Summarized (Group footer) portion of a Particular Employee instead of GETTING DETAIL SECTION where Every record repeats instead of Period. I have achieved it, But the Problem is the Minimum Function is not getting the accurate Minimum Period as Shown the picture. 在此处输入图片说明 The formula for I which I used to Show Minimum and Maximum period values is:

 Maximum ({DataTable1.Period}, {DataTable1.PPO_NO})&" - "& Minimum ({DataTable1.Period}, {DataTable1.PPO_NO})

and My Formula for getting Employee Month and Year are:

SELECT PPONO, Name, Father_Name,Designation,BPS,Claimant,Age,Type,IOT,  TblPPOBook.Pay_Month + '/' + CAST(TblPPOBook.Pay_Year AS nvarchar(4)) AS Period, Pension, Allow etc. From EmployeeTable Where PayDate Between Date1 ANd Date2.

The Early help in this regard will be highly appreciated.

Create a formula to convert string to date ie

@String to date:= Datevar Date_Period:=CDate({Period});

Second use this formula to find min and max date ie

Maximum ({@String to date}, {PPO No#})& " to " & Minimum ({@String to date}, {PPO No#}) ;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM