You need to sign in to do that
Don't have an account?
Vijaya Kumar Reganti
SOQL Query Help
Hi Friends,
I am trying to do the following query but I am not able to save it and I am getting an error like System.Today() Is not available.
Stats__c[] Stats = [Select Id,Mode_of_Travel__c,School__c FROM Stats__c Where CreatedDate = System.Today() ];
Please help me to figure out the problem here.
Hi Friends,
Finally I got my own Soution as follows.
Stats__c[] Stats = [Select Id,Mode_of_Travel__c,School__c FROM Stats__c WHERE CreatedDate = Today];
It worked.
All Answers
This query is perfectly fine, There is no relation between System.Today() and query.
You must have written some where else due to that line error is comming.kindly check your code.
Sorry the following is the query.
Stats__c[] Stats = [Select Id,Mode_of_Travel__c,School__c FROM Stats__c Where CreatedDate = System.Today() ];
Please help me to figure out the problem here.
Change you query like this, It will work.
Stats__c[] Stats = [Select Id,Mode_of_Travel__c,School__c FROM Stats__c Where CreatedDate = Today ];
Hi vijay,
you forgot to put ":" in your query. try to use following query.
SOQL Query:
Hi Friends,
Finally I got my own Soution as follows.
Stats__c[] Stats = [Select Id,Mode_of_Travel__c,School__c FROM Stats__c WHERE CreatedDate = Today];
It worked.