Click here to Skip to main content
12,243,333 members (45,334 online)
   

Database

 
GeneralRe: Select All Months and related data Pin
VishwaKL9-Dec-12 20:19
memberVishwaKL9-Dec-12 20:19 
GeneralRe: Select All Months and related data Pin
VishwaKL9-Dec-12 19:37
memberVishwaKL9-Dec-12 19:37 
GeneralRe: Select All Months and related data Pin
Deepak Kr110-Dec-12 20:27
memberDeepak Kr110-Dec-12 20:27 
GeneralRe: Select All Months and related data Pin
VishwaKL10-Dec-12 20:31
memberVishwaKL10-Dec-12 20:31 
GeneralRe: Select All Months and related data Pin
Deepak Kr110-Dec-12 22:02
memberDeepak Kr110-Dec-12 22:02 
GeneralRe: Select All Months and related data Pin
VishwaKL10-Dec-12 22:46
memberVishwaKL10-Dec-12 22:46 
GeneralRe: Select All Months and related data Pin
Deepak Kr110-Dec-12 23:25
memberDeepak Kr110-Dec-12 23:25 
QuestionSSRS 2005 Pin
berba6-Dec-12 7:32
memberberba6-Dec-12 7:32 
AnswerRe: SSRS 2005 Pin
David Mujica6-Dec-12 8:59
memberDavid Mujica6-Dec-12 8:59 
AnswerRe: SSRS 2005 Pin
djj556-Dec-12 10:30
memberdjj556-Dec-12 10:30 
AnswerRe: SSRS 2005 Pin
Mycroft Holmes6-Dec-12 17:57
memberMycroft Holmes6-Dec-12 17:57 
GeneralRe: SSRS 2005 Pin
berba6-Dec-12 19:06
memberberba6-Dec-12 19:06 
GeneralRe: SSRS 2005 Pin
Mycroft Holmes6-Dec-12 22:43
memberMycroft Holmes6-Dec-12 22:43 
QuestionSQL Group By Question Pin
loyal ginger6-Dec-12 6:27
memberloyal ginger6-Dec-12 6: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 11:11
memberBlue_Boy6-Dec-12 11:11 
GeneralRe: SQL Group By Question Pin
loyal ginger31-Dec-12 6:48
memberloyal ginger31-Dec-12 6:48 
QuestionIssues installing ODP.NETx64 Pin
cpp_prgmer6-Dec-12 5:18
membercpp_prgmer6-Dec-12 5:18 
AnswerRe: Issues installing ODP.NETx64 Pin
Eddy Vluggen6-Dec-12 15:37
memberEddy Vluggen6-Dec-12 15:37 
GeneralRe: Issues installing ODP.NETx64 Pin
Peter_in_27806-Dec-12 16:12
memberPeter_in_27806-Dec-12 16:12 
GeneralRe: Issues installing ODP.NETx64 Pin
Mycroft Holmes6-Dec-12 17:52
memberMycroft Holmes6-Dec-12 17:52 
AnswerRe: Issues installing ODP.NETx64 Pin
Mycroft Holmes6-Dec-12 17:53
memberMycroft Holmes6-Dec-12 17:53 
QuestionSQL Query - append results Pin
AndreFratelli5-Dec-12 7:43
memberAndreFratelli5-Dec-12 7:43 
AnswerRe: SQL Query - append results Pin
Chris Meech5-Dec-12 7:55
memberChris Meech5-Dec-12 7:55 
GeneralRe: SQL Query - append results Pin
AndreFratelli5-Dec-12 8:08
memberAndreFratelli5-Dec-12 8:08 
QuestionSQL 2008 Data Base Table Design suggestion Pin
VishwaKL5-Dec-12 0:36
memberVishwaKL5-Dec-12 0:36 
AnswerRe: SQL 2008 Data Base Table Design suggestion Pin
Simon_Whale5-Dec-12 0:43
memberSimon_Whale5-Dec-12 0:43 
GeneralRe: SQL 2008 Data Base Table Design suggestion Pin
VishwaKL5-Dec-12 0:47
memberVishwaKL5-Dec-12 0:47 
GeneralRe: SQL 2008 Data Base Table Design suggestion Pin
Simon_Whale5-Dec-12 0:51
memberSimon_Whale5-Dec-12 0:51 
AnswerRe: SQL 2008 Data Base Table Design suggestion Pin
PIEBALDconsult5-Dec-12 4:56
memberPIEBALDconsult5-Dec-12 4:56 
Question[HELP] how to using array in my case? (Query & PHP) Pin
jimmy.suharry4-Dec-12 21:14
memberjimmy.suharry4-Dec-12 21:14 
AnswerRe: [HELP] how to using array in my case? (Query & PHP) Pin
Mycroft Holmes4-Dec-12 21:38
memberMycroft Holmes4-Dec-12 21:38 
GeneralRe: [HELP] how to using array in my case? (Query & PHP) Pin
jimmy.suharry4-Dec-12 21:56
memberjimmy.suharry4-Dec-12 21:56 
QuestionSQL query Date Sort Problem Pin
AnirbanM 23-Dec-12 4:09
memberAnirbanM 23-Dec-12 4:09 
AnswerRe: SQL query Date Sort Problem Pin
ihoecken3-Dec-12 5:42
memberihoecken3-Dec-12 5:42 
GeneralRe: SQL query Date Sort Problem Pin
AnirbanM 23-Dec-12 19:46
memberAnirbanM 23-Dec-12 19:46 
AnswerRe: SQL query Date Sort Problem Pin
Eddy Vluggen3-Dec-12 6:20
memberEddy Vluggen3-Dec-12 6:20 
GeneralRe: SQL query Date Sort Problem Pin
AnirbanM 23-Dec-12 19:48
memberAnirbanM 23-Dec-12 19:48 
GeneralRe: SQL query Date Sort Problem Pin
Eddy Vluggen4-Dec-12 0:00
memberEddy Vluggen4-Dec-12 0:00 
AnswerRe: SQL query Date Sort Problem Pin
djj553-Dec-12 6:46
memberdjj553-Dec-12 6:46 
GeneralRe: SQL query Date Sort Problem Pin
AnirbanM 23-Dec-12 20:12
memberAnirbanM 23-Dec-12 20:12 
AnswerRe: SQL query Date Sort Problem Pin
PIEBALDconsult3-Dec-12 9:50
memberPIEBALDconsult3-Dec-12 9:50 
GeneralRe: SQL query Date Sort Problem Pin
Mycroft Holmes3-Dec-12 14:12
memberMycroft Holmes3-Dec-12 14:12 
GeneralRe: SQL query Date Sort Problem Pin
PIEBALDconsult3-Dec-12 14:18
memberPIEBALDconsult3-Dec-12 14:18 
GeneralRe: SQL query Date Sort Problem Pin
Mycroft Holmes3-Dec-12 17:18
memberMycroft Holmes3-Dec-12 17:18 
GeneralRe: SQL query Date Sort Problem Pin
PIEBALDconsult3-Dec-12 18:29
memberPIEBALDconsult3-Dec-12 18:29 
GeneralRe: SQL query Date Sort Problem Pin
AnirbanM 23-Dec-12 19:57
memberAnirbanM 23-Dec-12 19:57 
GeneralRe: SQL query Date Sort Problem Pin
AnirbanM 23-Dec-12 19:52
memberAnirbanM 23-Dec-12 19:52 
AnswerRe: SQL query Date Sort Problem Pin
Mycroft Holmes3-Dec-12 17:24
memberMycroft Holmes3-Dec-12 17:24 
GeneralRe: SQL query Date Sort Problem Pin
PIEBALDconsult3-Dec-12 18:28
memberPIEBALDconsult3-Dec-12 18:28 
GeneralRe: SQL query Date Sort Problem Pin
AnirbanM 23-Dec-12 20:07
memberAnirbanM 23-Dec-12 20:07 

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.


Advertise | Privacy | Mobile
Web01 | 2.8.160426.1 | Last Updated 30 Apr 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid