Solved

Max per month

Posted on 2016-11-30
3
50 Views
Last Modified: 2016-11-30
Experts, how would I be able to show a MAX for [Available WC]+[Available OD] AS AvailCumWCOD but for the month?  The field the keeps the date is [date].  

SELECT Import_FC_Archive.*, [Available WC]+[Available OD] AS AvailCumWCOD
FROM Import_FC_Archive
WHERE (((Import_FC_Archive.Date) Between DateSerial(Year(Date()),Month(Date())-3,1) And DateSerial(Year(Date()),Month(Date())+4,0)));


thank you
0
Comment
Question by:pdvsa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 17

Expert Comment

by:John Tsioumpris
ID: 41907120
With out looking at a sample of your data i can give you only a generic query
SELECT Import_FC_Archive.*
	,max([Available WC] + [Available OD] AS AvailCumWCOD)
FROM Import_FC_Archive
WHERE (
		(
			(Import_FC_Archive.DATE) BETWEEN DateSerial(Year(DATE ()), Month(DATE ()) - 3, 1)
				AND DateSerial(Year(DATE ()), Month(DATE ()) + 4, 0)
			)
		)
GROUP BY [All the fields you want to group by]

Open in new window

0
 
LVL 50

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 41907136
What do you think of with "but for the month"?

If for any month, then:
SELECT 
    Format(Import_FC_Archive.Date, "yyyy-mm") AS YearMonth,
    Max([Available WC]+[Available OD]) AS AvailCumWCOD
FROM 
    Import_FC_Archive
GROUP BY 
    Format(Import_FC_Archive.Date, "yyyy-mm")

Open in new window

/gustav
0
 

Author Closing Comment

by:pdvsa
ID: 41907596
thank you.
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question