Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help SELECT Field_x, MAX(Field_y) Returns Dups?

Status
Not open for further replies.

smedvid

MIS
May 28, 1999
1,228
0
0
US
Interesting one I have never seen before - a real puzzler for me...

I am attempting to select a distinct value for Field_X; then the max value for field_Y.

The select field_x, max(field_y) with group by field_x is returning duplicate rows.

field_y is a varchar(20), and field_y is an INT.

Any insight is greatly appreciated... seems like such a simple query to construct!
could it be just brain drain for a Friday?

Thanks in Advance for assistance in solving this puzzle.

Steve


Steve Medvid
IT Consultant & Web Master
 
Guess it must be Friday...
Data Issue where leading zero was truncated off Field_X...
Solution was to use Right('0000000'+Field_y,10) everywhere...
Worked like a charm...
TGIF!!!!!!!!!!!!!!

Steve Medvid
IT Consultant & Web Master
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top