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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datetime - Minimum Value - Little help please

Status
Not open for further replies.

BlurredVision

Technical User
Aug 6, 2001
326
GB
Attempting to display the minimum value of a datetime field excluding zero... I am using the following 3 formulas

Page Header:

@set
WhilePrintingRecords;
DateTimeVar HighDate := CDateTime (2999, 01, 01, 00, 00, 00);

Detailed Section:
@Get
WhilePrintingRecords;
DateTimeVar HighDate;
If {@Resumed} <> CDateTime (1900, 01, 01, 00, 00, 00) then
If {@Resumed} < HighDate then
HighDate := {@Resumed};
HighDate; //@resumed is just a datetime field

Group Footer:
@Display
WhilePrintingRecords;
DateTimevar HighDate;
HighDate;

I get no results from the above formulas.. Any ideas..
Thanks for any help given.
 
How about a simpler approach?

Write a formula that says:

If IsNull {DateTimefield}
then CDateTime (2999, 01, 01, 00, 00, 00)
else
if {DateTimefield}> CDateTime (1900, 01, 01, 00, 00, 00)
then {DateTimefield}
else CDateTime (2999, 01, 01, 00, 00, 00)

Now let CR do a minimum of this field using Insert - Grand Total or Insert - Summary. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top