Help with expression for Qtr

A

AccessKay

I’m not very good yet with writing expressions. How would I convert this
expression to get the quarter?

Month_1: Sum(IIf([TransDate] Between ([Forms]![frmVariance]![txtMo1]) And
DateAdd("m",1,([Forms]![frmVariance]![txtMo1]))-1,[tblTrans_Mstr].[Labor_Cost],0))

Thanks for any help.
 
K

KenSheridan via AccessMonster.com

Just change the interval argument of the DateAdd function from "m" to "q".

Ken Sheridan
Stafford, England
I’m not very good yet with writing expressions. How would I convert this
expression to get the quarter?

Month_1: Sum(IIf([TransDate] Between ([Forms]![frmVariance]![txtMo1]) And
DateAdd("m",1,([Forms]![frmVariance]![txtMo1]))-1,[tblTrans_Mstr].[Labor_Cost],0))

Thanks for any help.
 
A

AccessKay via AccessMonster.com

I'm having a good Access day today. Thanks Ken! I won't ask how to do the
year:)

Just change the interval argument of the DateAdd function from "m" to "q".

Ken Sheridan
Stafford, England
I’m not very good yet with writing expressions. How would I convert this
expression to get the quarter?
[quoted text clipped - 3 lines]
Thanks for any help.
 
K

KARL DEWEY

You can not get the Qtr from the [tblTrans_Mstr].[Labor_Cost] as it is not a
date.

Format([TransDate], "q") will give you a number representing the
quarter of the year that [TransDate] falls in.

Explain a little more of what you are trying to achieve.
 
J

John W. Vinson

I'm having a good Access day today. Thanks Ken! I won't ask how to do the
year:)

It might be prudent: you'll probably use "y" which is the day of the year
rather than the correct but noninuitive "yyyy".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top