2.5x 2.6x
WINDOWS
kbprg kbfixlist kbbuglist
The information in this article applies to:
- Microsoft FoxPro for Windows, versions 2.5x, 2.6x
SYMPTOMS
When you are using the Calculate Lowest option on a date field that is
in the Group band of a report, the lowest date in that grouping should
be returned, but a number is returned instead.
CAUSE
Calculate Lowest is returning the Julian date instead of the character
type date.
RESOLUTION
Workaround 1
To work around this problem, create the following user-defined function
(UDF):
- Create a field in the Group band.
- In the field, type:
MYUDF()
- Create a program named MYUDF.PRG that contains the following
commands:
mrecno=RECNO()
CALCULATE MIN(datefield) TO x
GOTO mrecno
RETURN x
Workaround 2
- From the Report Menu, choose Variables.
- Choose Add.
- For the Variable Name, type "mindate" (without the quotation marks).
- For the value you want to store, select the date field for which you
want the minimum value.
- For the Initial Value, select the date field again.
- Choose Lowest.
- At the end of the report, choose Reset. Or, if you are using a group,
choose Group.
STATUS
Microsoft has confirmed this to be a problem in the Microsoft products
listed at the beginning of this article. This problem was corrected in
Visual FoxPro 3.0 for Windows.
MORE INFORMATION
Steps to Reproduce Problem
- Create a database with a character field called NAME and a date
field called ZDATE.
- Enter the following three records:
NAME ZDATE
-----------------------
Paul 01/19/19
Paul 04/28/68
Paul 05/15/93
- Save the database.
- From the File menu, choose New, select Report, and then choose
New.
- From the Report menu, choose Quick Report, and choose OK.
- From the Report menu, choose Data Grouping.
- Choose Add and select the date field to group on. Choose OK three
times.
- Stretch the group footer to open a line.
- Click the ZDATE field in the Detail band.
- From the Edit menu, choose Copy.
- From the Edit menu, choose Paste.
- Move the new ZDATE field into the Group Footer band.
- Double-click the new ZDATE field in the Group Footer band.
- Select Calculate, select Lowest, and then choose OK twice.
- From the Report menu, choose Page Preview, and then choose Zoom In.
The result in the group footer is 2421978; it should be 01/19/19. If you
type ?SYS(11,'01/19/19') in the Command window, FoxPro returns 2421978,
which is the Julian date for 01/19/19.
|