Max of Date field in Crystal syntax

Hi Guys,

I have a requirement as below:

  1. get Maximum of ‘PlmtDate’ when PlmtCode <> ‘a,b,c’ and otherCode = ‘x,y’
    and
  2. get Maximum - 1 of ‘PlmtDate’ when PlmtCode = ‘a,b,c’ and otherCode = ‘x, y’ (has to pull last but previuos date)

I tried creating a formula with Crystal Syntax in crystal v10 but couldn’t succeed. :cry:

Any help would be really appreciated


sona_crystal (BOB member since 2009-10-14)

Hi,

Please create a formula which should be something like this:

if condition then
maximum({Orders.Order Date})
else if condition then
minimum({Orders.Order Date}) -1

Cheers!!!
Manish


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

Hi Manish,

tried using this but unfortunately doesn’t work either, btw can we use Minimum(date_field)-1? is it valid?

any other way of doing this would be helpful


sona_crystal (BOB member since 2009-10-14)

Hi,

You hae mentioned it is not working. Let me know whether any error is coming or the wrong output is coming.

Minimum (Date)-1 is valid.

Also, let me know the layout of the report and where exactly you want your formula to be means in which section of the report.

Cheers!!!
Manish


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

Manish I want to insert this formula field ‘date1’ in my subreport. It has to pull the date for this criteria:

If Plmt = ‘a’,‘b’,‘c’ and area <> ‘x’,‘y’ then pull the maximum of the ‘date1’ field

else if plmt = ‘a’,‘b’,‘c’ and area = ‘x’,‘y’ then pull ‘date1’ when rownum = 2 when its ordered by desc (hope its clear now: It has to pull the record previous to the maximum date)

Can u tell me hw to do it in crystal or basic syntax to create a formula field with this?

Sona…


sona_crystal (BOB member since 2009-10-14)

Hi,

If possible send me a sample report with saved data. Also, based on that report let me know your exact requirement.

Regards
Manish Tiwari


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