×
Discuss on Template programming, jBASE programming, Enquiries, No-File enquiry, Enquiry routines, Version, Version routines, Menus, Abbriviations, Creating local reference fields, Fast path enquiries, Creating charts and graphs, Generating Reports, Deal slips, Straight through processing, Multi Company and Multi Book setup, Tabbed screens, Composite Screens, T24 API, etc...
ICONV & OCONV for Date.Time field
- Tacka
-
Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 26
- Thank you received: 0
9 years 9 months ago #18196
by Tacka
ICONV & OCONV for Date.Time field was created by Tacka
hi,
I have START.DATE in format YYYYMMDD and the value is 20150930
In ENQ I set conversion to : JULIAN then OCONV D.E and I got 30.09.2015. That's correct.
For LIST ... EVAL "OCONV(ICONV(START.DATE, 'DJ'), 'D.E')"
My problem:
I have DATE.TIME in format YYMMDDHHMM
for exmple: 1509301230 -> I'd like to get 30.09.2015 12:30
1. How to define conversion in ENQ to get DD.MM.LLLL HH:MM ?
2. How to define conversion in LIST command to get DD.MM.LLLL HH:MM ?
thx..
I have START.DATE in format YYYYMMDD and the value is 20150930
In ENQ I set conversion to : JULIAN then OCONV D.E and I got 30.09.2015. That's correct.
For LIST ... EVAL "OCONV(ICONV(START.DATE, 'DJ'), 'D.E')"
My problem:
I have DATE.TIME in format YYMMDDHHMM
for exmple: 1509301230 -> I'd like to get 30.09.2015 12:30
1. How to define conversion in ENQ to get DD.MM.LLLL HH:MM ?
2. How to define conversion in LIST command to get DD.MM.LLLL HH:MM ?
thx..
Please Log in or Create an account to join the conversation.
- armin
-
- Offline
- Elite Member
-
- “So long - and thanks for all the fish!”
Less
More
- Posts: 300
- Thank you received: 57
9 years 9 months ago - 9 years 9 months ago #18198
by armin
Replied by armin on topic ICONV & OCONV for Date.Time field
For ENQUIRY easiest is to write a small routine that converts O.DATA the way you want it, e.g.
O.DATA = TRIM(O.DATA)
IF O.DATA THEN
DATE.YY = O.DATA[1,2]
DATE.MM = O.DATA[3,2]
DATE.DD = O.DATA[5, 2]
TIME.HH = O.DATA[7,2]
TIME.MM = O.DATA[9,2]
O.DATA = DATE.DD:".":DATE.MM:".20":DATE.YY:" ":TIME.HH:":":TIME.MM
END
The same can be used in EVAL (routine using parameter instead of O.DATA) or a complex EVAL :
EVAL"DATE.TIME[5,2]:'.':DATE.TIME[3,2]:'.20':DATE.TIME[1,2]:' ':DATE.TIME[7,2]:':':DATE.TIME[9,2]"
Alternatively define a USR.FIELD.NAME as TYPE = "I" in STANDARD.SELECTION with USR.FIELD.NO like the EVAL statement and use this in ENQUIRY and LIST.
O.DATA = TRIM(O.DATA)
IF O.DATA THEN
DATE.YY = O.DATA[1,2]
DATE.MM = O.DATA[3,2]
DATE.DD = O.DATA[5, 2]
TIME.HH = O.DATA[7,2]
TIME.MM = O.DATA[9,2]
O.DATA = DATE.DD:".":DATE.MM:".20":DATE.YY:" ":TIME.HH:":":TIME.MM
END
The same can be used in EVAL (routine using parameter instead of O.DATA) or a complex EVAL :
EVAL"DATE.TIME[5,2]:'.':DATE.TIME[3,2]:'.20':DATE.TIME[1,2]:' ':DATE.TIME[7,2]:':':DATE.TIME[9,2]"
Alternatively define a USR.FIELD.NAME as TYPE = "I" in STANDARD.SELECTION with USR.FIELD.NO like the EVAL statement and use this in ENQUIRY and LIST.
Last edit: 9 years 9 months ago by armin.
Please Log in or Create an account to join the conversation.
- kripesh
-
- Offline
- Platinum Member
-
Less
More
- Posts: 459
- Thank you received: 65
7 years 2 months ago #21749
by kripesh
Have a great day !
Replied by kripesh on topic ICONV & OCONV for Date.Time field
Go to the DATE.TIME field in the enquiry and
In the TYPE field put D. I think this alone is enough to display the Date and Time properly in their respective formats.
In the TYPE field put D. I think this alone is enough to display the Date and Time properly in their respective formats.
Have a great day !
Please Log in or Create an account to join the conversation.
Time to create page: 0.037 seconds