0
votes

Using Access 2013 I have a calculated a column in a query that is the datediff from a clients intake date to now(), the formula is:

DateDiff("d",[table1]![intake_date],Now())

So the column will give the total number of days the client has been our client. This works great. Each client has a total number of days populated. Now what I want to do is add those numbers up to find the total number days from that column. What I can't figure out is how to get a sum of that column to populate in a textbox. I have a form with a textbox that I want to sum to show in. The formula I assumed would work is

=Sum([queryname]![columnname]) 

but that is not working.

1

1 Answers

1
votes
=Sum([columnname]) 

can only be used if columnname is a field in the form's RecordSource.
Typically in the footer of a continuous form.

To show the sum of a query that is independent of the form, use the DSum function:

=DSum("columnname", "queryname")