I need to convert a parameter to pull the previous 2nd month. current month is 09 14, I need to pull 07 14/ I used below convert, but somthing not right:
&MTH --072014 I want &MTH1 is 062014
-SET &MTH1 = DATECVT(DATEADD(DATECVT(&MTH,'I6YYMM','YYMM'),'M', -1), 'YYMM','I6YYMM');This message has been edited. Last edited by: <Kathryn Henning>,
In the future, please be more consistent in your question. In your original post, you state "previous 2nd month. current month is 09 14, I need to pull 07 14", then you state "&MTH --072014, I want &MTH1 is 062014", then you show code "-SET &MTH1 = DATECVT(DATEADD(DATECVT(&MTH,'I6YYMM','YYMM'),'M', -1), 'YYMM','I6YYMM');" - first you want to subtract two months, then 1 month. You show dates as Month/Year, but your code is Year/Month...
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
September 25, 2014, 09:37 AM
Jing grace
IT worked very well. Thank you all for your help!
WebFOCUS 7.6 Windows, All Outputs
September 25, 2014, 06:49 PM
Waz
FYI,
There is also a legacy function called AYM that you could have used.