Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

max / min returns incorrect value

Status
Not open for further replies.

BlurredVision

Technical User
Aug 6, 2001
326
0
0
GB
I have the following formula within my report header:

"Date: " & date(Minimum ({DT1.Date})) & ' to ' & date(Maximum ({DT1.Date})) & chr(013) &
"Generated: " & currentdatetime;

My issue is, the min / max values being displayed are incorrect. I use a boolean formula to select data

Example:
{@Select_Date} and
{DT1.ContraAct} startswith "C"

If I select my data in this manner the min / max date is returned has 6/21 - 6/22

If I select date based on the following statement:

{DT1.Date} in Lastfullweek

The min / max value are returned properly.

Any ideas why crystal feels the need to ignore the min / max values when I select on a true/false formula?

Many thanks..
 
What is the content of {@SelectDate}?

-LB
 
What's in your @selectdate formula ?

Gary Parker
MIS Data Analyst
Manchester, England
 
Minimum ({DT1.Date}) is returning the earliest date returned in your recordset.

CR does not ignore any dates so the 2 selection formuals must be returning different results.

Gary Parker
MIS Data Analyst
Manchester, England
 
This is the formula:

if {?Posted Date} = 'MonthToDate' and date({JDT1.RefDate}) in MonthToDate then true else
if {?Posted Date} = 'YearToDate' and date({JDT1.RefDate}) in YearToDate then true else
if {?Posted Date} = 'LastFullWeek' and date({JDT1.RefDate}) in LastFullWeek then true else
if {?Posted Date} = 'LastFullMonth' and date({JDT1.RefDate}) in LastFullMonth then true else
if {?Posted Date} = 'YearToDate' and date({JDT1.RefDate}) in YearToDate then true else
//Q1
if ({?Posted Date} = 'Calendar1stQtr' and
month ({JDT1.RefDate}) in [8,9,10] and
year({JDT1.RefDate}) = {?Fiscal Year}) then true else

//Q2
if ({?Posted Date} = 'Calendar2ndQtr' and
month ({JDT1.RefDate}) in [11,12] and
year({JDT1.RefDate}) = {?Fiscal Year}) then true else

if ({?Posted Date} = 'Calendar2ndQtr' and
month ({JDT1.RefDate}) in [1] and
year({JDT1.RefDate}) = {?Fiscal Year} + 1) then true else

//Q3
if ({?Posted Date} = 'Calendar3rdQtr' and
month ({JDT1.RefDate}) in [2,3,4] and
year({JDT1.RefDate}) = {?Fiscal Year} + 1) then true else

//Q4
if ({?Posted Date} = 'Calendar4thQtr' and
month ({JDT1.RefDate}) in [5,6,7] and //Q4
year({JDT1.RefDate}) = {?Fiscal Year} + 1)then true else

//Full Fiscal Year
if ({?Posted Date} = 'Fiscal Year (Year to Date)' and
month ({JDT1.RefDate}) in [8,9,10,11,12] and
year({JDT1.RefDate}) = {?Fiscal Year}) then true else

if ({?Posted Date} = 'Fiscal Year (Year to Date)' and
month ({JDT1.RefDate}) in [1,2,3,4,5,6,7] and
year({JDT1.RefDate}) = {?Fiscal Year} + 1) then true else true
 
Saw the issue after I posted that.. the last line - true else true...

that was causing my issue.. Thanks for your time
 
What was your parameter selection when you returned 6/21-6/22?

You should check the case of your pick list values to make sure they match your formula, and also, the default should be "else false", not "else true". If you want all values to show, you should present that as an option "All Dates".

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top