If you are looking for the maximum date for each schedule, try the following
SELECT sched, max(rvyrmo) FROM savectl00 GROUP BY sched ORDER
BY sched
Alan Shore
Programmer/Analyst, Direct Response
E:AShore@xxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Michael Kirkpatrick
Sent: Thursday, January 17, 2013 5:02 PM
To: Midrange Systems Technical Discussion
Subject: Re: problem with max date
max(RVYRMO) = 201303
therefore, your results are correct
201303 A
201303 C
201303 D
From: "Smith, Mike" <Mike_Smith@xxxxxxxxxxxxxxxx>
To: "Midrange Systems Technical Discussion (midrange-l@xxxxxxxxxxxx)"
<midrange-l@xxxxxxxxxxxx>,
Date: 01/17/2013 01:57 PM
Subject: problem with max date
Sent by: midrange-l-bounces@xxxxxxxxxxxx
I have a scenario where I need to pick this record with the highest YR/MO from a file.
Records are like this
RVYRMO SCHED
201301 A
201301 B
201301 C
201301 D
201303 A
201303 C
201303 D
My query doesn't pick up the record
201301 B
My query looks like this
SELECT RVYRMO , SCHED,
FROM savectl00 where RVYRMO = (select max(RVYRMO) from savectl00 )
My results are
201303 A
201303 C
201303 D
My searching seems to indicate this is how to do it, but I'm not having any luck.
What am I doing wrong?
Thanks
Mike
NOTICE: This message, including any attachment, is intended as a confidential and privileged communication. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at
http://archive.midrange.com/midrange-l.
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose to anyone this email or any information contained in this email. If you have received this email in error, please advise the sender by replying to this email, and delete this email immediately. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Western Dental Services, Inc. Finally, the recipient should check this email and any attachments for the presence of viruses. Western Dental Services, Inc. accepts no liability for any damage caused by any virus transmitted by this email.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at
http://archive.midrange.com/midrange-l.
Disclaimer: This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.
As an Amazon Associate we earn from qualifying purchases.