Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you have any questions or need access: Contact myibi@ibi.com


Connect to myibi

Read-Only Read-Only Topic
Go
Search
Notify
Tools
DATE in QUOTE
 Login/Join
 
Platinum Member
posted
I have a Date that I want to be put in quotes through the use of a Define.

Generally this is what I have:
DEFINE FILE HOLDMAIN
CTR/I9 = LAST CTR + 1;
CONDITIONAL/A5 = IF CTR EQ 1 THEN '' ELSE 'OR';
STATUS/A8 = EVENT_STATUS;
DATE/HYYMDS = EVENT_EFF_DATE;
CODE/A8 = EVENT_CODE;
END

BUT when I put them in single quotes I use this:

DEFINE FILE HOLDMAIN
CTR/I9 = LAST CTR + 1;
CONDITIONAL/A5 = IF CTR EQ 1 THEN '' ELSE 'OR';
STATUS/A8 = '''' || EVENT_STATUS || '''';
DATE/HYYMDS = '''' || EVENT_EFF_DATE || '''';
CODE/A8 = '''' || EVENT_CODE || '''';
END

Everything works fine EXCEPT the Date. All I want to do is display it in single quotes.

TABLE FILE HOLDMAIN
PRINT
CONDITIONAL
DATE
END

Which would look like this:

CONDITIONAL DATE
(BLANK) '01/01/2005'
OR '01/02/2005'


Does this make sense?

Thanks for your help!
 
Posts: 178 | Registered: May 11, 2005Report This Post
Expert
posted Hide Post
Try this. You have to convert the HYYMDS date to alpha to append anything to it:

DEFINE FILE CAR
DATE1/HYYMDS = HINPUT(8, '20050523', 8, 'HYYMDS');
DATE2/A22 = '''' || HCNVRT(DATE1,'(HYYMDS)',20,'A20') || '''';
END
TABLE FILE CAR
PRINT
CAR
DATE1
DATE2
BY COUNTRY
END
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
That worked!! Thanks so much... the only one I used was the HCNVRT, but I had never seen that function so would never have thought of it.

Thanks a million again.
 
Posts: 178 | Registered: May 11, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders