MONTH & YEAR FROM DATE
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 75
- Joined: Mon Jul 12, 2010 4:11 am
- Location: Chennai
MONTH & YEAR FROM DATE
Hi,
Pls let me know what is function to be used to get
only month & year from date. Format is below
Input: YYYY-MM-DD
Output: MM-YY
Thanks & Regards,
Pls let me know what is function to be used to get
only month & year from date. Format is below
Input: YYYY-MM-DD
Output: MM-YY
Thanks & Regards,
Ajitha S
-
- Participant
- Posts: 75
- Joined: Mon Jul 12, 2010 4:11 am
- Location: Chennai
-
- Participant
- Posts: 75
- Joined: Mon Jul 12, 2010 4:11 am
- Location: Chennai
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Code: Select all
Right("00":MonthFromDate(InLink.TheDate) : "-" : Right(YearFromDate(InLink.TheDate),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.
Ray,ray.wurlod wrote:...Code: Select all
Right("00":MonthFromDate(InLink.TheDate) : "-" : Right(YearFromDate(InLink.TheDate),2)
Should we use:
Right("00":MonthFromDate(InLink.TheDate),2) : "-" : Right(YearFromDate(InLink.TheDate),2)
??? as the requirement is MM-YY?
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Took me a minute but the difference is the "2" that was added at the end of this part for the month:
Code: Select all
Right("00":MonthFromDate(InLink.TheDate),2)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Code: Select all
Right("00":MonthFromDate(InLink.TheDate), 2) : "-" : Right(YearFromDate(InLink.TheDate), 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.