Solved

Max per month

Posted on 2016-11-30
3
15 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
3 Comments
 
LVL 13

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 49

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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now