You need to sign in to do that
Don't have an account?
SOQL Dates between
Write an SOQL Query to fetch students who joined in between january 1st 2021 to till today date. I want only SOQL Query to execute without list or set
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
you can take the reference of below code . Here first we create instance of january 1st 2021 and todays date and then we use below query to fetch records of student who join in betweeen these day .
Here Student__c is Sobject and JoinedDate__c is field of Student __c SObject
Date startDate = Date.newInstance(2021, 1, 1);
Date TodayDate = system.today();
[SELECT Id,Name FROM Student__c WHERE JoinedDate__c >: startDate AND JoinedDate__c <=: TodayDate ];
If you find your Solution then mark this as the best answer.
Thank you!
Regards,
Suraj Tripathi