You need to sign in to do that
Don't have an account?
Subha Ayyappan 7
SOQL to get the records created in a day, week and month
Hi all,
I want to get the records of an object created in a day, week and month all in the same query. Is it possible?
I want to get the records of an object created in a day, week and month all in the same query. Is it possible?
You have query the record from a specific date range. And the by code you can create a MAP and maintain the data in MAP.
You can do only this if you want to use only single query. Otherwise you have to query with differenct date criteria.
-Thanks
Ashlekh Gera
Below are my 3 queries which i want to make it one because i do not want to take the physician name 3 times.
Select Encountered_Physician_Id__r.User__r.FirstName,count(Encounter__c.Id) from Encounter__c where CreatedDate = today Group By Encountered_Physician_Id__r.User__r.FirstName
Select Encountered_Physician_Id__r.User__r.FirstName,count(Encounter__c.Id) from Encounter__c where CreatedDate = Last_week Group By Encountered_Physician_Id__r.User__r.FirstName
Select Encountered_Physician_Id__r.User__r.FirstName,count(Encounter__c.Id) from Encounter__c where CreatedDate = Last_month Group By Encountered_Physician_Id__r.User__r.FirstName
Is it possible? Please help.