[AccessD] SubQuery Help???

Gustav Brock gustav at cactus.dk
Sun Jan 25 03:40:30 CST 2004


Hi Mark

What if several dates of the same id show identical amounts?

/gustav


> I wasn't quite clear...here is the data

> ID  Date  Amount
> a  2/3        4.5
> a  2/4         5.8
> b  2/3         3.7
> b  2/4         2.5
> a  2/6         3.8

> The results I would like to see are:
> ID  Date  Amount
> a  2/4      5.8
> b  2/3      3.7



>>From: Brett Barabash <BBarabash at tappeconstruction.com>
>>Reply-To: Access Developers discussion and problem 
>>solving<accessd at databaseadvisors.com>
>>To: "'Access Developers discussion and problem solving'" 
>><accessd at databaseadvisors.com>
>>Subject: RE: [AccessD] SubQuery Help???
>>Date: Sat, 24 Jan 2004 15:08:36 -0600
>>
>>Howzabout:
>>
>>SELECT ID, Date, Amount
>>FROM MyTable
>>WHERE Date Between [A-Date] And [B-Date]
>>AND Amount =
>>   (SELECT Max([Amount])
>>   FROM MyTable
>>   WHERE Date Between [A-Date] And [B-Date])
>>
>>-----Original Message-----
>>From: Mark A Matte [mailto:markamatte at hotmail.com]
>>Sent: Saturday, January 24, 2004 2:17 PM
>>To: accessd at databaseadvisors.com
>>Subject: [AccessD] SubQuery Help???
>>
>>
>>Hello All,
>>
>>I'm having a brain cramp...I have a table with 3 fields: ID, Date, Amount.
>>I'm pulling the records between A-Date and B-Date...from these records I
>>need the date where the Amount is greatest...can someone refresh my
>>memory...



More information about the AccessD mailing list