Forum Discussion

jose_guadamuz's avatar
jose_guadamuz
New Contributor II
7 years ago

Can i insert a parameter in a SOQL statement

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

  • akelpe's avatar
    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?

    • jose_guadamuz's avatar
      jose_guadamuz
      New Contributor II

      @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”