You need to sign in to do that
Don't have an account?
Anil Meghnathi
Date/Time Formula in Where condition of SOQL query
I tried the following query but it's not working.Any idea will help me.
list<BlockedUser__c> bu=new list<BlockedUser__c>();
bu=[select ID,UserID__c,Days__c,Blocking_Date__c from BlockedUser__c where Blocking_Date__c+Days__c>:System.now()];
Thanks
Anil
You can't manipultate the field value in the where clause to add another field to it. The way that I'd handle this is to define a formula field on Blocked_User__c that adds Blocking_Date__c to Days__c and then compare that against the current time. Also, if your formula returns a date you may need to compare against System.today() rather than System.now().
Thanks for your reply.
I had tried it but it still thowing error.
please can you write that formula which you have implemented
Thanks
Anil
That's not how these boards work - you post your formula and we'll see if we can figure out what's wrong.