function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Eager-2-LearnEager-2-Learn 

How to have a report produce YTD

Hello,

 

I see many different built in function such as TODAY or THIS WEEK, for example; however, I do not see one for YEAR TO DATE!


Does anyone know how I can get a report to dynamically get year to day date only?

 

Best Answer chosen by Admin (Salesforce Developers) 
kingkong94538kingkong94538

You can use Today function with This Year to get what you want. (My response is based on the limited information you provided in your question).

 

For example,

 

Select Id from Account

where CreatedDate = THIS_YEAR and CreatedDate <= TODAY

 

The result will be all account ids that are created till today (starting from 1st Jan). Hope this helps but if it does not, let me know and please provide more details about what you are trying to achieve.

 

Thanks!

All Answers

kingkong94538kingkong94538

You can use Today function with This Year to get what you want. (My response is based on the limited information you provided in your question).

 

For example,

 

Select Id from Account

where CreatedDate = THIS_YEAR and CreatedDate <= TODAY

 

The result will be all account ids that are created till today (starting from 1st Jan). Hope this helps but if it does not, let me know and please provide more details about what you are trying to achieve.

 

Thanks!

This was selected as the best answer
Eager-2-LearnEager-2-Learn

Thank you for the support.