Combining numbers from two seperate columns
Combining numbers from two seperate columns
(OP)
How can i combine two numerical comlumns togeter. Ie. the month is 12 and year is 2007, which would equal 12/2007.
Thanks,
Thanks,
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS Contact USThanks. We have received your request and will respond promptly. Come Join Us!Are you a
Computer / IT professional? Join Tek-Tips Forums!
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting Guidelines |
Combining numbers from two seperate columns
|
Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.
Here's Why Members Love Tek-Tips Forums:
Register now while it's still free!
Already a member? Close this window and log in.
RE: Combining numbers from two seperate columns
For example, if you want an ALPHA string, a DEFINE would work:
CODE
On the other hand, if you wanted a 'date' field, you could do the following:
CODE
By having the format as a 'legacy' date, the slash is added automatically, be default.
Once you have a 'legacy' date, you can convert it to a 'smart date' by assignment:
CODE
RE: Combining numbers from two seperate columns
Thanks,
RE: Combining numbers from two seperate columns
I used this statment A8 and the result for everything is 00/0000. Why is it not working?
Thanks,
Kerry
RE: Combining numbers from two seperate columns
RE: Combining numbers from two seperate columns
Kerry
RE: Combining numbers from two seperate columns
What are the Master File Descriptions (MFD) of the fields in question? ie what is the format? Actual and Usage? Length?
This will help us answer your question.
RE: Combining numbers from two seperate columns
thanks,
RE: Combining numbers from two seperate columns
When you use EDIT(AGENCY_SALES_V.AGENCY_SALES_V.MTH, '99'),
you are telling WF to get the FIRST two bytes of the field, hence the zeroes in your answer. This being a numeric field, the information is right justified and you would want the last two bytes.
E.G. EDIT(AGENCY_SALES_V.AGENCY_SALES_V.MTH, '$$$$$$$$$99')
The $ tells WF to omit or skip the first nine bytes in the field and use the last two.
HTH
RE: Combining numbers from two seperate columns
The first one I recieve:
(FOC282) RESULT OF EXPRESSION IS NOT COMPATIBLE WITH THE FORMAT OF FIELD: DATE
When checking the second formula I recieve this error
(FOC253) INVALID FORMAT SPECIFICATION ON LEFT HAND SIDE: I6YM
I just do not understand what is going on... All I want is to combine the fileds so they read MM/YYYY....
Please help...
Thanks
RE: Combining numbers from two seperate columns
this may help.
First convert your I fields to Alpha, then use Edit to extract the components you need.
DEFINE FILE XXXX
AMONTH/A11 = EDIT(MTH);
AYEAR/A11 = EDIT(YR);
MTHYR/A23 = EDIT(AMONTH,'$$$$$$$$$99') || '/' || EDIT(AYEAR,'$$$$$$$9999');
END
RE: Combining numbers from two seperate columns
RE: Combining numbers from two seperate columns