A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

SumIf Help



 
 
Thread Tools Display Modes
  #1  
Old August 6th, 2007, 07:12 PM posted to microsoft.public.access.reports
Karin
external usenet poster
 
Posts: 272
Default SumIf Help

Hi, I want to do something like this:

If [ProjectFYE] between #1/1/2006# and #12/31/2006# Sum [BudgetHrs].

I want to do this in a report group footer.

TIA
  #2  
Old August 6th, 2007, 09:34 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default SumIf Help

Try use:
=Sum(Abs([ProjectFYE] between #1/1/2006# and #12/31/2006#) *[BudgetHrs])

--
Duane Hookom
Microsoft Access MVP


"Karin" wrote:

Hi, I want to do something like this:

If [ProjectFYE] between #1/1/2006# and #12/31/2006# Sum [BudgetHrs].

I want to do this in a report group footer.

TIA

  #3  
Old August 7th, 2007, 01:16 PM posted to microsoft.public.access.reports
Karin
external usenet poster
 
Posts: 272
Default SumIf Help

Duane,

Thank you. After several hours, this is what I came up with. I don't
really understand why I need to use the Abs reference. I thought Abs was
just to get a positive number (even if the answer was a negative).

=Abs(Sum(([ProjectFYE] Between #01/01/2006# And #12/31/2006#)*[BudgetHrs]))


"Duane Hookom" wrote:

Try use:
=Sum(Abs([ProjectFYE] between #1/1/2006# and #12/31/2006#) *[BudgetHrs])

--
Duane Hookom
Microsoft Access MVP


"Karin" wrote:

Hi, I want to do something like this:

If [ProjectFYE] between #1/1/2006# and #12/31/2006# Sum [BudgetHrs].

I want to do this in a report group footer.

TIA

  #4  
Old August 7th, 2007, 01:24 PM posted to microsoft.public.access.reports
Karin
external usenet poster
 
Posts: 272
Default SumIf Help

I forgot to mention that your response works great and its a little cleaner.

"Karin" wrote:

Duane,

Thank you. After several hours, this is what I came up with. I don't
really understand why I need to use the Abs reference. I thought Abs was
just to get a positive number (even if the answer was a negative).

=Abs(Sum(([ProjectFYE] Between #01/01/2006# And #12/31/2006#)*[BudgetHrs]))


"Duane Hookom" wrote:

Try use:
=Sum(Abs([ProjectFYE] between #1/1/2006# and #12/31/2006#) *[BudgetHrs])

--
Duane Hookom
Microsoft Access MVP


"Karin" wrote:

Hi, I want to do something like this:

If [ProjectFYE] between #1/1/2006# and #12/31/2006# Sum [BudgetHrs].

I want to do this in a report group footer.

TIA

  #5  
Old August 7th, 2007, 02:32 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default SumIf Help

Why I use Abs():
This expression will return either 0 (False) or -1 (True).
([ProjectFYE] Between #01/01/2006# And #12/31/2006#)
Abs() will convert the -1 to 1.

--
Duane Hookom
Microsoft Access MVP


"Karin" wrote:

I forgot to mention that your response works great and its a little cleaner.

"Karin" wrote:

Duane,

Thank you. After several hours, this is what I came up with. I don't
really understand why I need to use the Abs reference. I thought Abs was
just to get a positive number (even if the answer was a negative).

=Abs(Sum(([ProjectFYE] Between #01/01/2006# And #12/31/2006#)*[BudgetHrs]))


"Duane Hookom" wrote:

Try use:
=Sum(Abs([ProjectFYE] between #1/1/2006# and #12/31/2006#) *[BudgetHrs])

--
Duane Hookom
Microsoft Access MVP


"Karin" wrote:

Hi, I want to do something like this:

If [ProjectFYE] between #1/1/2006# and #12/31/2006# Sum [BudgetHrs].

I want to do this in a report group footer.

TIA

  #6  
Old August 7th, 2007, 04:48 PM posted to microsoft.public.access.reports
Karin
external usenet poster
 
Posts: 272
Default SumIf Help

The "Ah ha" moment. Thank you!

"Duane Hookom" wrote:

Why I use Abs():
This expression will return either 0 (False) or -1 (True).
([ProjectFYE] Between #01/01/2006# And #12/31/2006#)
Abs() will convert the -1 to 1.

--
Duane Hookom
Microsoft Access MVP


"Karin" wrote:

I forgot to mention that your response works great and its a little cleaner.

"Karin" wrote:

Duane,

Thank you. After several hours, this is what I came up with. I don't
really understand why I need to use the Abs reference. I thought Abs was
just to get a positive number (even if the answer was a negative).

=Abs(Sum(([ProjectFYE] Between #01/01/2006# And #12/31/2006#)*[BudgetHrs]))


"Duane Hookom" wrote:

Try use:
=Sum(Abs([ProjectFYE] between #1/1/2006# and #12/31/2006#) *[BudgetHrs])

--
Duane Hookom
Microsoft Access MVP


"Karin" wrote:

Hi, I want to do something like this:

If [ProjectFYE] between #1/1/2006# and #12/31/2006# Sum [BudgetHrs].

I want to do this in a report group footer.

TIA

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:54 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.