I currently have a tag that calculates the current total for the past 7 days, but would like to change it to calculate the total starting from the previous Sunday midnight.
Assuming that you are using the TagTot function, you can calculate starting from the previous Sunday at midnight by changing the start time to the abbreviation sun. This would look something like this:
TagTot(attname, 'sun', '*' [, pctgood])
where attname is the AF attribute or PI tag name and [, pctgood] is an optional value that states the minimum percentage of the specified time range that the attribute's values must be good.
If you have more questions, you can refer to this page regarding TagTot or this page regarding PI Time Abbreviations.
Retrieving data ...