0
votes

I'm using InfoPath 2003 to produce a form which includes a repeating table of records that include a date field (StartDate) and a value field (TotalElapsed). I have date pickers for start and end dates on the form (beginDate and endDate), and there is a text box after the table which I want to have show the total sum of the integer field for records that have a date between the start and end date selections. The text box value parameter generated when I use the 'Insert Field or Group...' and 'Filter Data...' options, is below:

sum(@TotalElapsed[msxsl:string-compare(@StartDate, beginDate) >= 0 and msxsl:string-compare(@StartDate, endDate) <= 0])

This gives almost the correct sum calculation, with the exception that any records with a date that matches the end date are not included in the sum. Any records with dates from (and including) the start date, up to the day before the end date, are all included in the sum. Any ideas why the end date records aren't included in the sum?

Thanks

1

1 Answers

0
votes

The above equation works fine. To use the >= and <= the Start Date should be in type of Date.

sum(Total[msxsl:string-compare(StartDate, BeginDate) >= 0 and msxsl:string-compare(StartDate, EndDate) <= 0])