Re: Distinct Max Value?
From: Bob Barrows [MVP] (reb01501_at_NOyahoo.SPAMcom)
Date: 01/18/05
- Next message: Chris Crowe: "How to parse data into groups and then filter - pivot?"
- Previous message: Jon Jacobs: "Re: Copy image data"
- In reply to: rjcmbc: "Re: Distinct Max Value?"
- Next in thread: Alejandro Mesa: "RE: Distinct Max Value?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 17 Jan 2005 19:20:28 -0500
rjcmbc wrote:
> Ok, here is my Create Table Script:
>
> SELECT r.runNumber,
Umm, that is not a Create Table script. I can tell because the script does
not contain the words "CREATE TABLE". :-)
> As you can see I am trying to extract the maximum number from the
> 'SignOffTime' field. This is an INT data type btw.
Well that is what I wanted to know. So let's see a real "CREATE TABLE"
script (trim it down to the columns that are relevant to this issue after
you use Enterprise Manager to generate it (see the aspfaq url I posted
earlier)
some INSERT statements containing sample data so we can see how the data is
stored, and some unioned select statements to generate the results you wish
to return from the sample data you provide
>
> However, I don't seem to be getting the desired result. I get the MAX
> SignOffTime value for all 'RunNumbers' instead of just the one Max
> value for each runnumber group.
You need a GROUP BY clause. See my previous response.
-- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM"
- Next message: Chris Crowe: "How to parse data into groups and then filter - pivot?"
- Previous message: Jon Jacobs: "Re: Copy image data"
- In reply to: rjcmbc: "Re: Distinct Max Value?"
- Next in thread: Alejandro Mesa: "RE: Distinct Max Value?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|