As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at firstname.lastname@example.org and provide your corporate email address, company, and name.
Hello Every one, I am having trouble figuring out the equivalent code for below scenario.
I am trying to convert CURRENT_DATE() to 2 digit month but its notworking. I used EXTRACT(MONTH FROM CURRENT_DATE()), and also used MONTH(CURRENT_DATE()) but both the functions giving only single digit month.
If I get the double digit month, i can concatenate YYYY||Q||MM and convert it to number using TO_NUMBER.
Let me know if there is a better way to get the below values from CURRENT_DATE()
I need below values from CURRENT_DATE() in the format of YYYYQMM as integer (EX: 2020204, 2020205,2020206,2020307 ..etc)
1) PREVIOUS_MONTH = Previous month (EX: 2020204) 2) CURRENT_MONTH = Current Month (EX: 2020205) 3) Next_YEAR_END = Next year end (EX: 2021412) 4) CURRENT_YEAR_BEGIN = Current Year Begin (EX: 2020101) 5) CURRENT_YEAR_END = current Year End (EX: 2020412)
My DM Flow generated SQL is below:
SELECT MAX(FM.CURRENT_MONTH_ID ) AS Current_ID , CURRENT_DATE() AS "CURRENT_DATE" , EXTRACT(MONTH FROM CURRENT_DATE() ) AS Current_MONTH , MONTH(CURRENT_DATE() ) AS Current_Month_2 , YEAR(CURRENT_DATE() ) AS CURRENT_YEAR , QUARTER(CURRENT_DATE() ) AS Current_Quarter FROM factmanufacture FM
Please help me with the code.
Thanks a lot, AnishaThis message has been edited. Last edited by: FP Mod Chuck,