"Use case regarding functions"

Hi,

I have a doubt in using text() function and datetext() function, as i already gone through the documentation suggesting that both are quite similar only difference is their syntax.

my doubt is, at which scenario's we can go for these functions. Can anyone of you make me understand with some live scenarios.

 

 

 

 

Thanks & Regards,

KDR

  Discussion posts and replies are publicly visible

  • Hi @Dharma,
    If you can look into the description of both the functions. In text() function we can type cast Converts number, date, time, or datetime timestamp into string or any specific format like this : text(2,"$0.0"), but it is not possible in datetext().

    datetext() : Interprets the date or datetime specified in the user preferred calendar and returns its string representation using given format.

    Thanks,
    Sandeep

  • Hi,
    Text takes many types of inputs but datetext needs a date as input.As the name suggests datetext is for dates and text can be used for other types also.
    Thanks,
    Yeswanth.
  • Hi Dharma Rao,

    The datetext() function uses a similar, but slightly different syntax than the text function.
    and apart form that datetext() function can not take the integer value as input to convert into specified date format(ex:datetext(0,"mm/dd/yyyy") leads to error), where as text() can take the integer input value and gives the date (ex: text(0,"mm/dd/yyyy") -->O/P 01/01/2035) . text () function treats 01/01/2035 as base date, for positive value text() function will add the date to base date for negative value it will decrease the date from base date(ex: text(10,"mm/dd/yyyy") -->O/P 01/11/2035, text(-10,"mm/dd/yyyy") -->O/P 12/22/2034).

    Thanks,
    Ravindar G