My Assistant
![]() ![]() |
|
|
Mar 14 2005, 05:01 PM
Post
#1
|
|
|
UtterAccess Enthusiast Posts: 99 |
I am trying to find out, how I can program a criteria line in an access query that does the following:
Sums a monthly amount to a year to date total. For example, if the month the user is looking at is October (field name = SignedDate), the year to date total should display the sum of an amount from January to October. I looked at Between...And...But I am not quite sure how to solve the problem. Rahel |
|
|
|
Mar 14 2005, 05:27 PM
Post
#2
|
|
|
UtterAccess Addict Posts: 280 From: Suffolk, England, UK |
You could set an expression with the following criteria :-
Month_No: Month([SignedDate]) This would give you the current month, eg October = 10 In another field you could have a formula, such as IIf(Month_No=1,Month1,IIf(Month_No=2,Month1+Month2,IIF(Month_No=3,Month1+Month2+ Month3,IIF(...etc))) Just a thought, haven't tried it myself, but it looks as if it would work in a query. Good luck. |
|
|
|
Mar 14 2005, 05:58 PM
Post
#3
|
|
|
UA Editor + Utterly Certified Posts: 22,726 From: Melton Mowbray,Leicestershire (U.K) |
Hi
Also try this: Month_No: Month([SignedDate]) Criteria: Between Month(DateSerial(Year(Date()),1,1)) And Forms!FormName!UsersInput UsersInput = 10 Search would be between 1 & 10 (Jan > Oct) HTH's (IMG:http://www.utteraccess.com/forum/style_emoticons/default/thumbup.gif) |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 19th June 2013 - 07:19 PM |