You need to sign in to do that
Don't have an account?
OnDem Dev
Need help on Dynamic SOQL query with date condition in where clause
Hi,
I constructed a dynamic soql query and query looks like below,
Date dateVal = Date.today();
Database.query('select field1, field2, field3, dateField1 from Object__c where field1 = :val1 && dateField1 >= :dateVal');
As binding variables is supported, the formed query should work.
But i am getting no result when i sun this query.
Can any one help me out with a possible solution?
Any help on this is highly appreciated.
Thanks,
OnDemand
I tried even that format, but id doen'nt work out. This is what i did,
Database.query('select field1, field2, field3, dateField1 from Object__c where field1 = '\'+val1+\'' and dateField1 >= '\'+dateVal+\'' ');
Or can you just correct me where i am wrong.
Or can you provide with an example
Thanks,
OnDemand
Hi,
I was trying to convert a servertimestamp to date to add it to query. I am reading servertimestamp from a file as a string.
String date = simpleDate.format("Tue Apr 07 10:54:46 EDT 2009");
System.out.println(date);
This is giving exception
any suggestions.