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  

Sum fields on Wednesday



 
 
Thread Tools Display Modes
  #1  
Old August 12th, 2005, 02:48 PM
Chris
external usenet poster
 
Posts: n/a
Default Sum fields on Wednesday

Hi everyone,

Does anyone know how to sum up values in a field that are on a certain day
only. For example: I have a table with two fields, one field is called "Oil"
and the other is "Date". I want to get the sum of all the Oil records that
were on a Wednesday.

Thanks,
Chris
  #2  
Old August 12th, 2005, 10:02 PM
Duane Hookom
external usenet poster
 
Posts: n/a
Default

Date is a bad name for a field since it is the name of a function.

However, try an expression like:
=Sum( Abs(WeekDay([Date]) = 4) * [Oil])

--
Duane Hookom
MS Access MVP


"Chris" wrote in message
...
Hi everyone,

Does anyone know how to sum up values in a field that are on a certain day
only. For example: I have a table with two fields, one field is called
"Oil"
and the other is "Date". I want to get the sum of all the Oil records
that
were on a Wednesday.

Thanks,
Chris



  #3  
Old August 12th, 2005, 10:14 PM
Chris
external usenet poster
 
Posts: n/a
Default

Thanks, Duane It worked perfectly.

-Chris

"Duane Hookom" wrote:

Date is a bad name for a field since it is the name of a function.

However, try an expression like:
=Sum( Abs(WeekDay([Date]) = 4) * [Oil])

--
Duane Hookom
MS Access MVP


"Chris" wrote in message
...
Hi everyone,

Does anyone know how to sum up values in a field that are on a certain day
only. For example: I have a table with two fields, one field is called
"Oil"
and the other is "Date". I want to get the sum of all the Oil records
that
were on a Wednesday.

Thanks,
Chris




  #4  
Old August 13th, 2005, 07:06 PM
Wolfgang Kais
external usenet poster
 
Posts: n/a
Default

Hello Chris.

"Chris" wrote:

Does anyone know how to sum up values in a field that are on a
certain day only. For example: I have a table with two fields, one
field is called "Oil" and the other is "Date". I want to get the sum
of all the Oil records that were on a Wednesday.


=Sum(Iif(Weekday([Date])=4,[Oil],0))

--
Regards,
Wolfgang


 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Calculations Bruce Worksheet Functions 11 May 19th, 2005 01:09 AM
improving performance by indexing query criteria fields Paul James General Discussion 20 February 16th, 2005 07:55 PM
Can't Add Fields to Form Jeff Miller Using Forms 4 January 12th, 2005 03:42 AM
Outlook contacts doesn't allow all fields from Excel? gnmcewen Contacts 0 January 9th, 2005 04:21 AM
Automatic filling of fields in table two from table one Jim Kelly Database Design 1 September 27th, 2004 10:16 PM


All times are GMT +1. The time now is 03:07 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.