Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Filtering data using a date field (from SalesForce) = today date

Hello,
I'm a beginner in Talend...
What i want to do is simple, i want to make a filter based on a date field (LastModifiedDate) from SalesForce...
My selection will only contain records which where modified today... 
In tmap i added this filter :
TalendDate.getDate("YYYY-mm-dd")=TalendDate.formatDate("yyyy-MM-dd",row1.LastModifiedDate)
And each time i try i got : "the left side of an assignment must be a variable"...
I do really have a problem with syntax... can you help me ?
My whish, something simple Smiley Happy
Labels (3)
10 Replies
Anonymous
Not applicable
Author

Hi 
Try this expression:
TalendDate.getDate("YYYY-mm-dd").equals(TalendDate.formatDate("yyyy-MM-dd",row1.LastModifiedDate))
Anonymous
Not applicable
Author

Yes this seems great... thanks a lot...
Now my problem is : the processe will read all the rows of the source table... and will not let anything goint thrue tmap (date formating problem ??)
Maybe it would be better to put the equivalent in the query condition directly in the tSalesforceInput... but the syntax is one more time different ...
Would you help me again ? Smiley Happy
I already do a lot of thing with Talend, it's an incredible soft, love it Smiley Wink
Anonymous
Not applicable
Author

If i put in query condition :
"SkuUpdDate__c='2016-02-04'" it works perfectly...
what should i put instead of '2016-02-04' to get today's date ? something like get date ect....
Thanks in advance
Anonymous
Not applicable
Author

I found the main problem : the Lastmodified date is stored like this (in SalesForce) :"yyyy-MM-dd'T'HH:mm:ss'.000Z'"
What conversion shall i do to this field to get : mm-dd-yyyy ... would be perfect... as a string maybe ?
Same question for getdate() to get todays date... as a string too ?... (same type the last modified date) to be able to compare the two.
NNekkanti1658462243
Contributor
Contributor

Hi team write lastmodified date = getdate-1 in tsalesforce component under query condition.Please help me out .I am getting below error if i use condition. It is very critical

Anonymous
Not applicable
Author

@Navyasri Nekkanti​ , can you try to query the lastmodified date field from Salesforce and see what's the date format is retrieved?

 

 

NNekkanti1658462243
Contributor
Contributor

Hi Shong, Thank you for response Date Format : 2019-03-01 00:23:11.000 Regards N Navyasri Engineer
Anonymous
Not applicable
Author

The lastmodified date contains date and time part, you only want the date part =currentDate-1?, eg:

​"...where lastmodifieddate='2023-02-12'"

NNekkanti1658462243
Contributor
Contributor

Date and datetime,both are fine Sent from Mail<> for Windows