Forum Discussion

groverarena's avatar
groverarena
New Contributor
7 years ago

DateMacro For Netezza Execute

Hi,
I am new to SnapLogic and I am trying to execute a Generic JDBC for Netezza. The query works fine and output a table to Oracle. How can I add a macro on the fly for the previous month last date of the month. I tried documentation but it’s not helping much.
Can somebody please guide?

Details:
FROM NZ_MODEL.ATTBN_PODS_MTH_ASSIGNMENT T
JOIN NZ_MODEL.ATTBN_PROVIDER_STG P
ON T.SRC_PROV_UNIQ_ID = P.SRC_PROV_UNIQ_ID
// Previous Month Last Date//
WHERE T.AS_OF_DATE_SKEY=20190131; (Need to replace that with macro)

4 Replies

    • dmiller's avatar
      dmiller
      Former Employee

      I don’t know Netezza, but I think there was a similar date request using our expression language in this Community. Let me see if I can find it…

      Edited to add the link to start with: Expression - Last Day of the Month - #6 by aaronb.
      This might be a good starting point with a couple options.

      • groverarena's avatar
        groverarena
        New Contributor

        Hi,
        How can I debug these expressions or check in values in Snaplogic?
        Date.now().plusMonths(1).withDayOfMonth(1).minusDays(1)