I need to calculate the difference, measured in days or weeks, between two dates. Can this be done using AdvStringGrid or AdvSpreadGrid? The date/time functions for the AdvSpreadGrid seem rather limited. Any assistance will be appreciated.
I tried the demo AdvSpreadGrid and it calculates the difference in days, just like I want. Can this be done with the AdvStringGrid (which has no built in formula functions) or should I replace my AdvStringGrid with the AdvSpreadGrid and do the calculations programmatically?
There is currently unfortunately not a built-in function to do this.
I'm not sure how exactly you'd want to do this calculation. Is this a fixed calculation or does the user need to specify how to do this calculation? With the first, you can programmatically do this by using Delphi's date functions applied to grid.Dates[col,row]: TDateTime.
When this needs to be end-user configurable, you could implement a custom function library in TAdvSpreadGrid to do this. In the unit MiscMathLib.pas you can see several sample custom function libraries implemented.
When this needs to be end-user configurable, you could implement a custom function library in TAdvSpreadGrid to do this. In the unit MiscMathLib.pas you can see several sample custom function libraries implemented.