cancel
Showing results for 
Search instead for 
Did you mean: 

DateMacro For Netezza Execute

groverarena
New Contributor

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 4

groverarena
New Contributor

@tmiller @dstack, can you help?

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.


Diane Miller

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

You can use the “Dynamic Validation” feature to see the results of expressions as you enter them. To view the results of sub-expressions, for example Date.now().plusMonths(1), you can move the cursor to that part of the expression to see those results.

Here’s a gif of DV in action:

debug-date-expr