Desktop productivity for business analysts and programmers

Converting a numeric month value into MMDDYY8. format

Reply
New Contributor
Posts: 3

Converting a numeric month value into MMDDYY8. format

[ Edited ]

Hello,

 

I am looking to use an INTNX statement in order to capture the month end date of a value, however I do not have a 'date' field that would normally be entered in the INTNX statement. What I do have is a column listing the numeric value of a month (i.e. 5 if it's May), and a 2nd column listing the numeric value of the year (i.e. 2016).

 

Any recommendations as to the fastest way to use the '5' and '2016' values to end up with a 05/31/2016 format?

 

Thanks!

 

Cait

 

Attachment
Respected Advisor
Posts: 4,966

Re: Converting a numberic month value into MMDDYY8. format

Assuming your month and year values are numeric, here's a phrase you could enter wherever INTNX is expecting to see a date:

 

mdy(month, 1, year)

Respected Advisor
Posts: 4,606

Re: Converting a numberic month value into MMDDYY8. format

So that would be:

 

lastDayOfMonth = intnx("MONTH", mdy(month, 1, year), 0, "END");
format lastDayOfMonth mmddyy10.;
PG
New Contributor
Posts: 3

Re: Converting a numberic month value into MMDDYY8. format

Hello PGStats,



Thank you for your response, it works perfectly! Thanks for helping me learn (I never used the MDY function).



Greatly appreciated!



Caisha


Ask a Question
Discussion stats
  • 3 replies
  • 222 views
  • 1 like
  • 3 in conversation