Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have created a calculated field for a content type in my Sharepoint 2010 and I want to return a date in the TEXT format because I am returning some text with it. The condition I have put in the formula is:

IF(
    AND([ShowModifiedDate];[ShowCreatedDate]);
    "Create date is [Created] and update date is [Modified]";
    IF(
        [ShowModifiedDate];
        [Modified];
        IF(
            [ShowCreatedDate];
            [Created];
            [ArticleDate]
            )
        )
    )

Here I have to return the result in "Single Line of Text" instead of "Date time". I have tried TEXT function (TEXT([Modified],"dd-mm-yyyy")) for the same but it's always giving an error "The formula contains a syntax error or is not supported.". But I can't see any error in the query which I am returning. I have all the columns present in the list.

Even though if I write below thing in formula it's returning me the same error..

TEXT([Modified],"dd mmm yyyy hh:mm ")

Any help would be appreciated.

share|improve this question
add comment

3 Answers 3

Did you put the "=" in front of the formula in the calculated field?

See pictures below, it worked for me

formular display

share|improve this answer
add comment

It seems like you're mixing semicolon separators ; (in your main formula) and comma separators , (in the TEXT function).

It's also worth double-checking all your field names are correct: It may be a translation difference, but the [Changed] and [Change] fields are usually called [Modified].

share|improve this answer
    
Thanks for pointing the , and ; issue. But the machine is setup for the DK environment where I have to provide ; instead of , . And the field name there is Changed. Sorry for typo error above. :(. The exact field name is "Oprettet" in DK. Here I have translated the field name. Any other help is highly appreciated. IF I am using the filed with DateTime in formula then it's returning me the correct result. So it means the field is also doing good. –  Ankit Sep 17 '12 at 11:53
    
So you've changed the , inside the TEXT call to a ; you're saying? It might help to post the entire broken formula, to clarify the problem. –  Stuart Pegg Sep 17 '12 at 14:23
    
here is the formula which I am using into formula field. IF(AND([Visskabedato];[Visopdateringsdato]);"Create date is [Oprettet] and update date is [Ændret]";IF([Visskabedato];[Oprettet];IF([Visopdateringsdato];[Ændret];[Artikel‌​dato]))). But now I have done this thing in another way. I have used this article (corypeters.net/2008/06/…) to hide and show the publishing control. –  Ankit Sep 18 '12 at 6:28
add comment

If as DateTime its working fine then you can also use the following to get the text

DAY(Modified)&"-"&MONTH(Modified)&"-"&YEAR(Modified)
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.