Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a SUM Ytd and ThisPeriod Column 1

Status
Not open for further replies.

johnve

Technical User
Dec 6, 2006
10
AU
Hi I'm trying to create a This Period and Year to Date fields.

Current Table has:
Item, Amount, Period (month of transaction), RPeriod (Current Month)

What I want to do is have the following fields:
This Period: Sum of Amount where Period = RPeriod
YTD: Sum of Amount where Period >= 1 and <= RPeriod

Is this possible?
 
Your table needs serious structural help if you are storing just the month number for your periods. Also, current month probably belongs in a separate table.

Although when you conditionally want to sum the value, I use the IIF function...

IIF(Period = RPeriod, Amount, 0)

Check it out in help and see if it makes sense.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top