Mr Gunther
Thanks
We modify this code
- Code: Select all Expand view
if :nFooterType == AGGR_MIN .or. :nFooterType == AGGR_MAX
:nTotal := nil
endif
as
- Code: Select all Expand view
if :nFooterType == AGGR_MIN .or. :nFooterType == AGGR_MAX
:nMinVal := nil // necessary
:nMaxVal := nil // necessary
endif
New thought to extend MAX and MIN to other types also
For the existing code:
- Code: Select all Expand view
if HB_ISNUMERIC( nValue )
if :nMinVal == nil .or. nValue < :nMinVal
:nMinVal := nValue
endif
if :nMaxVal == nil .or. nValue > :nMaxVal
:nMaxVal := nValue
endif
:nTotal += nValue
:nTotalSQ += ( nValue * nValue )
endif
we may substitute this new code
- Code: Select all Expand view
if :nMinVal == nil .or. nValue < :nMinVal
:nMinVal := nValue
endif
if :nMaxVal == nil .or. nValue > :nMaxVal
:nMaxVal := nValue
endif
if HB_ISNUMERIC( nValue )
:nTotal += nValue
:nTotalSQ += ( nValue * nValue )
endif
With this change we can have AGGR_MAX and AGGR_MIN for dates and character values also
What are your comments?
When the programmer sets AGGR_MAX or AGGR_MIN he is also responsible to ensure that all values of the column should of same datatype or nil.