cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Can i insert a parameter in a SOQL statement

jose_guadamuz
New Contributor II

Hello - I am new to snaplogic and working on a SFDC read SOQL statement. I need to insert the Date.Now() function in the SNAP SOQL.

For example

Select d.Id, From Deployment_Contact__c d where d.Contact__c != null and d.Deployment__r.Customer__c != null and (date.Now() > 2014-10-18T00:05:12.000+0000 or d.Deployment__r.LastModifiedDate > Date.Now())

Is this possible ?

2 REPLIES 2

akelpe
Former Employee

If you toggle the equals sign button next to the text field for the SQL query, the field becomes an expression and you can use the expression language to dynamically construct the query. Is that what you want?

@akelpe - yes that was one of the issues but also i got some help the expression below worked for me,

Date.now().toLocaleDateTimeString(โ€˜{ โ€œformatโ€:โ€œyyyy-MM-ddโ€}โ€™)+โ€œTโ€+Date.now().toLocaleDateTimeString(โ€˜{ โ€œformatโ€:โ€œHH:mm:ssโ€}โ€™)+โ€œZโ€