简体   繁体   English

在Crystal Report公式中获取最大值和最小值

[英]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. 我将带有数据集的VS 2012与Crystal Report一起使用,并在运行时填充报告。 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}); @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#}) ; 最大值({@String to date},{PPO No#})&“到&&最小值({@String to date},{PPO No#});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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