Getting a Date in An integer format
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 38
- Joined: Thu Nov 04, 2004 10:36 am
Getting a Date in An integer format
Hi all,
i have to write a date in an integer format. can anyone please help me out.
Thanks,
Ravi
i have to write a date in an integer format. can anyone please help me out.
Thanks,
Ravi
-
- Participant
- Posts: 38
- Joined: Thu Nov 04, 2004 10:36 am
Actually, was looking for a little more detail than that. Examples of input and output formats are always good.
If what you mean is that you need to strip formatting characters from the date, look at - in no particular order - the Trim and EReplace functions. The latter can be used to replace a character with 'nothing', in effect removing it from the target field.
More details will yield more targetted advice.
If what you mean is that you need to strip formatting characters from the date, look at - in no particular order - the Trim and EReplace functions. The latter can be used to replace a character with 'nothing', in effect removing it from the target field.
More details will yield more targetted advice.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
Try this !
Modify the format according to your requirements.
LET ME KNOW IF IT WORKED.
Thanks,
Naveen.
Code: Select all
TRIM((OCONV(ICONV(DSLink.InDate,"DYMD[2,2,2]"), "DYMD[4,2,2]")), " ", "A")
LET ME KNOW IF IT WORKED.
Thanks,
Naveen.
-
- Participant
- Posts: 38
- Joined: Thu Nov 04, 2004 10:36 am
What Craig was asking is to define what the integer format should look like. Should it be YYYYMMDD, or MMDDYYYY, padding with zeroes, what? Should it be the integer number of days since a given start date, what does integer(10) mean? That's not a common term for describing a date without delimiters.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If the input date is already in YYYY-MM-DD then the solution given is non-optimal. All you need to do to get YYYYMMDD is to strip out the "-" characters. Some possible solutions are:
- Trim(inLink.TheDate, "-", "A")
Convert("-", "", inLink.TheDate)
Oconv(inLink.TheDate, "MCN")
inLink.TheDate[1,4] : inLink.TheDate[6,2] : inLink.TheDate[9,2]
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.