Help with DatePart function

njload

Registered User.
Local time
Today, 18:54
Joined
Apr 24, 2013
Messages
10

Was wondering if there is a way to incorporate the DatePart function in the below statement to filter out sales tax by quarter? I have two drop down boxes that filter the year and the state but the below only totals the tax for the year and state. I am trying to add 4 text boxes to show the quarterly break down of sales tax.

The below text box is in a form pulling the data from a query.

Any help is appreciated.

Text Box

=DSum("[SalesTaxCharged]","[Sales Tax Calculation Qry]","Year([Order Date])=[SelectedYear] And [StateProv]=[SelectedState] And Not [Tax Exempt]")
 
jdraw thanks for the response, I have already used =DatePart("q",[Order Date]) in reports and other applications to get the required results, I was wondering if there were a way to get it in the formula above.
 
any other ideas? maybe another way to code the field?

any help is appreciated.
 
You can grab that value, the total tax and divide it by four. Edit each of the quarterly boxes and in the control source line, type in

=TotalTax/4

Better:
=Round(TotalTax/4,2)

The word TotalTax should be the name of the box where your DSum is located.
 
Solved: had to tweek my query and got the results I wanted.

thanks to every one who responded.
 

Users who are viewing this thread

Back
Top Bottom