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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |