× 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
  • Tacka's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 23
  • Thank you received: 0

Tacka created the topic: ICONV & OCONV for Date.Time field

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..
#18196

Please Log in or Create an account to join the conversation.

  • armin
  • armin's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • “So long - and thanks for all the fish!”
  • Posts: 300
  • Karma: 13
  • Thank you received: 57

armin replied the 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.

using R11 on Unix
#18198

Please Log in or Create an account to join the conversation.

  • Posts: 411
  • Karma: 10
  • Thank you received: 52

kripesh replied the 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.

Have a great day !
#21749

Please Log in or Create an account to join the conversation.

Time to create page: 0.240 seconds