5 replies
by creative
Step one, to get your total in one column, sum it. It will sum it by the date, so create a second query based on the first one, but don't use the date range, just the nember and sum the number - you now have a total for the column.
To perform more math on it:
Use the builder to select the field or qry you want and the imple math symbols to do the math for you. A lot can be done with parenthesis in one qry.
Hope this helps.
by rschultz
by bob sellman
If you have a form that provides viewing of this table, you could use the DSum function to calculate the totals you need.
For example:
Dim lngTotal1 as Long
Dim lngTotal2 as Long
Dim dblPercent as Double
lngTotal1 = DSum("[Col1]","[TableName]","[Date] = #" & me.txtSelectedDate & "#")
lngTotal2 = DSum("[Col2]","[TableName]","[Date] = #" & me.txtSelectedDate & "#")
dblPercent = 100 * lngTotal1/lngTotal2
The third part of the DSum calculation is the where clause. In this exampleI've assumed that the column called [Date] must equal the date in the current form (me) object called txtSelectedDate.
by rschultz
by rschultz
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending