4 Replies Latest reply: Sep 28, 2018 5:32 AM by Tim Poismans

# Count Accounts using Today

Hi,

I need a calculate field 'New accounts this month' to have a calculations as follows:

if M_Date (formatted YYYY-MM-DD) = current month then 1 else 0

Any idea how to write the syntax for this please?

• ###### Re: Count Accounts using Today

count(distinct {<M_Date={">=\$(=date(monthstart(Today(1)),'YYYY-MM-DD'))<=\$(=date(monthend(Today(1)),'YYYY-MM-DD'))"}>} NewAccount)

• ###### Re: Count Accounts using Today

count(distinct {<M_Date={">=\$(=date(monthstart(Today(1)),'YYYY-MM-DD'))<=\$(=date(monthend(Today(1)),'YYYY-MM-DD'))"}>} NewAccount)

I get an error message confirming - Unrecognized symbol: {

• ###### Re: Count Accounts using Today

maybe like this

if (Max(M_Date)=Date(Today(),'YYYY-MM-DD'),1,0)

• ###### Re: Count Accounts using Today

Hi Steve

Try the following, with your fields of course:

Count({<Month={"\$(=Month(Today()))"},Year={"\$(=Year(Today()))"}>}distinct AccountID)