Advertisement

06.12.2008 at 11:13AM PDT, ID: 23480545
[x]
Attachment Details

Grouping in SQL wth two summaries

Asked by Lmunilla in Crystal Reports Software, MS SQL Server

Tags: crystal reports, crystal reports, X, sql

What Am I doing wrong? Here is my select statement.  I want the highest WO# by EQ with ir's correswponding meter.  I jsut want to receive one entry by EQM.

select
ltrim( rtrim(equipment)) "eqm",
max(wonumber) "WONUMBER",
meterpos
from
emwork
where svcid ='Repair'
group by ltrim( rtrim(equipment)) ,max(wonumber), meterpos
My current Results are:
EQ              WO#      Meter
-------    ------        ------
AIR 015      9            5
AIR 015      15            11
AIR 015      35            3
BLD001     11            70
BLD001     22            83
BLD 001    51            150

REsult Desired
EQ              WO#      Meter
-------    ------        ------
BLD 001    51            150
AIR 015      35            3



Start Free Trial
 
Loading Advertisement...
 
[+][-]06.12.2008 at 11:22AM PDT, ID: 21772268

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.12.2008 at 11:28AM PDT, ID: 21772310

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.12.2008 at 11:31AM PDT, ID: 21772331

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.12.2008 at 11:34AM PDT, ID: 21772360

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.12.2008 at 11:39AM PDT, ID: 21772416

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.12.2008 at 11:41AM PDT, ID: 21772442

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.12.2008 at 11:46AM PDT, ID: 21772482

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.12.2008 at 11:55AM PDT, ID: 21772566

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Crystal Reports Software, MS SQL Server
Tags: crystal reports, crystal reports, X, sql
Sign Up Now!
Solution Provided By: i2mental
Participating Experts: 3
Solution Grade: A
 
 
[+][-]06.12.2008 at 12:02PM PDT, ID: 21772621

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628