79678994

Date: 2025-06-25 11:55:07
Score: 1
Natty:
Report link

Thank you for the solution! It helped my use case, where I was trying to generate one row for each month between an employee’s START_DATE and END_DATE. I adjusted the code from the solution to:

SELECT 
    EE_NUMBER,
    LAST_DAY(DATEADD(MONTH, VALUE::INT, START_DATE) AS DATE_OF_EXPORT,
    END_DATE
FROM STG_MAIN_DATA,
TABLE(FLATTEN(ARRAY_GENERATE_RANGE(0, DATEDIFF(MONTH, START_DATE, END_DATE)+1)));

I`ll leave this in this thread, in case it might be useful for someone in my situation.

Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: DianaDuta