Click here to Skip to main content
15,885,537 members
Home / Discussions / Database
   

Database

 
GeneralRe: Select All Months and related data Pin
Deepak Kr110-Dec-12 22:25
Deepak Kr110-Dec-12 22:25 
QuestionSSRS 2005 Pin
berba6-Dec-12 6:32
berba6-Dec-12 6:32 
AnswerRe: SSRS 2005 Pin
David Mujica6-Dec-12 7:59
David Mujica6-Dec-12 7:59 
AnswerRe: SSRS 2005 Pin
Corporal Agarn6-Dec-12 9:30
professionalCorporal Agarn6-Dec-12 9:30 
AnswerRe: SSRS 2005 Pin
Mycroft Holmes6-Dec-12 16:57
professionalMycroft Holmes6-Dec-12 16:57 
GeneralRe: SSRS 2005 Pin
berba6-Dec-12 18:06
berba6-Dec-12 18:06 
GeneralRe: SSRS 2005 Pin
Mycroft Holmes6-Dec-12 21:43
professionalMycroft Holmes6-Dec-12 21:43 
QuestionSQL Group By Question Pin
loyal ginger6-Dec-12 5:27
loyal ginger6-Dec-12 5:27 
I am trying to do this in Microsoft Access. I seem to be unable to construct a 'simple' query. To illustrate, here is a sample table:

Field1	Field2	Amount 
A	New	10
D	Old	5
G	Old	1
H	Old	15
H	New	55
X	Old	20
Z	Old	100
Z	New	20


I need to group by Field1 and only return the Field2 data for the record that has the maximum number in the Amount field. I tried to use the 'First' function but Microsoft Access sort the records internally so it does not return the right value even if I pre-sort the records with a sub-query. Do you have any advice? The result should look like the table below.

Desired Result:
Field1	Field2	Max(Amount)
A	New	10
D	Old	5
G	Old	1
H	New	55
X	Old	20
Z	Old	100

I have trouble getting the value of Field2 in the record containing to the maximum value of 'Amount.'

Any suggestions? Thanks in advance for your time!

modified 6-Dec-12 11:51am.

AnswerRe: SQL Group By Question Pin
Blue_Boy6-Dec-12 10:11
Blue_Boy6-Dec-12 10:11 
GeneralRe: SQL Group By Question Pin
loyal ginger31-Dec-12 5:48
loyal ginger31-Dec-12 5:48 
QuestionIssues installing ODP.NETx64 Pin
cpp_prgmer6-Dec-12 4:18
cpp_prgmer6-Dec-12 4:18 
AnswerRe: Issues installing ODP.NETx64 Pin
Eddy Vluggen6-Dec-12 14:37
professionalEddy Vluggen6-Dec-12 14:37 
GeneralRe: Issues installing ODP.NETx64 Pin
Peter_in_27806-Dec-12 15:12
professionalPeter_in_27806-Dec-12 15:12 
GeneralRe: Issues installing ODP.NETx64 Pin
Mycroft Holmes6-Dec-12 16:52
professionalMycroft Holmes6-Dec-12 16:52 
AnswerRe: Issues installing ODP.NETx64 Pin
Mycroft Holmes6-Dec-12 16:53
professionalMycroft Holmes6-Dec-12 16:53 
QuestionSQL Query - append results Pin
AndreFratelli5-Dec-12 6:43
AndreFratelli5-Dec-12 6:43 
AnswerRe: SQL Query - append results Pin
Chris Meech5-Dec-12 6:55
Chris Meech5-Dec-12 6:55 
GeneralRe: SQL Query - append results Pin
AndreFratelli5-Dec-12 7:08
AndreFratelli5-Dec-12 7:08 
QuestionSQL 2008 Data Base Table Design suggestion Pin
VishwaKL4-Dec-12 23:36
VishwaKL4-Dec-12 23:36 
AnswerRe: SQL 2008 Data Base Table Design suggestion Pin
Simon_Whale4-Dec-12 23:43
Simon_Whale4-Dec-12 23:43 
GeneralRe: SQL 2008 Data Base Table Design suggestion Pin
VishwaKL4-Dec-12 23:47
VishwaKL4-Dec-12 23:47 
GeneralRe: SQL 2008 Data Base Table Design suggestion Pin
Simon_Whale4-Dec-12 23:51
Simon_Whale4-Dec-12 23:51 
AnswerRe: SQL 2008 Data Base Table Design suggestion Pin
PIEBALDconsult5-Dec-12 3:56
mvePIEBALDconsult5-Dec-12 3:56 
Question[HELP] how to using array in my case? (Query & PHP) Pin
jimmy.suharry4-Dec-12 20:14
jimmy.suharry4-Dec-12 20:14 
AnswerRe: [HELP] how to using array in my case? (Query & PHP) Pin
Mycroft Holmes4-Dec-12 20:38
professionalMycroft Holmes4-Dec-12 20:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.