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
StardustStardust 

YEAR(Date) pulls out format X.XXX or X,XXX - how can I get XXXX

Hi there,

 

this is simple, but I am a bit stuck. I am trying to pull out the YEAR of a date, using the Number Type Formula YEAR(Date).

However I am getting the correct result, but in the wrong format.

If the date is 30/10/1987, I would like to get 1987, but what I am getting is 1.987.

What determines the formatting of that number? How can I change this?

 

Thanks very much

Best Answer chosen by Admin (Salesforce Developers) 
@anilbathula@@anilbathula@

HI 

 

The best work around which i can suggest u created one more fromula field .

Make return type as text.

put this formula :-

Text(put ur 1 formula field ).

Thats it it will show u the exact format which u are looking for.

Hide the first formula field fromula field from the page layout.

 

Thanks

Anil.B

 

 

 

 

 

All Answers

@anilbathula@@anilbathula@

Hi

 

With date field u cant get  exactly like this1987.

if u want exactly like then it should be a text field not a date field.

At present there no such functionality for formating  and u can vote for this type of functionality.

http://success.salesforce.com/ideaview?id=08730000000BrGKAA0

 

Thanks

Anil.B

 

StardustStardust

Thanks Anil!

 

But is there a workaround?

@anilbathula@@anilbathula@

HI 

 

The best work around which i can suggest u created one more fromula field .

Make return type as text.

put this formula :-

Text(put ur 1 formula field ).

Thats it it will show u the exact format which u are looking for.

Hide the first formula field fromula field from the page layout.

 

Thanks

Anil.B

 

 

 

 

 

This was selected as the best answer
StardustStardust

thanks