× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



SQL has similar substring function:

select substr(deldat, 02, 06) AS YYMMDD
from LC95

In this example, deldat is a zoned or numeric 7,0
field with a CYYMMDD date value

Sample output is:
....+.
YYMMDD
120716

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Hoteltravelfundotcom
Sent: Thursday, December 05, 2013 8:13 AM
To: Midrange Systems Technical Discussion
Subject: Re: Simple use of substr problem

how would you do that in sql then?
i just want to total according to year and month


On Thu, Dec 5, 2013 at 9:42 AM, Gary Thompson <gthompson@xxxxxxxxxxx> wrote:

Actually, I think Rob got it right: query - NOT rpg

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:
midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Gary Thompson
Sent: Thursday, December 05, 2013 7:34 AM
To: Midrange Systems Technical Discussion
Subject: RE: Simple use of substr problem

Try looking at a manual: substr does not exist in rpg, you want subst
or %subst


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:
midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Hoteltravelfundotcom
Sent: Thursday, December 05, 2013 7:20 AM
To: Midrange Systems Technical Discussion
Subject: Simple use of substr problem

HI I am trying to use in this field, ittrnd, it is yyyymmdd. I need to
total according to year/month so i want to substr that but this is not
allowing me, any idea why?

YYMM substr(ittrnd,1,6) yyyymm 6
00













Bottom


Field Text Len
Dec
ITPRT# PART NUMBER 15

ITQTY# QUANTITY 13
2
ITTRNS TRANSACTION TYPE 4

ITTRND TRANSACTION DATE 8
0

More...
F3=Exit F5=Report F9=Insert F11=Display names
only
F12=Cancel F13=Layout F20=Reorganize F24=More keys

SUBSTR value is not allowed.
--
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 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 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 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.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.