Solved

Max per month

Posted on 2016-11-30
3
43 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 16

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

730 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