Skip to Content
author's profile photo Former Member
Former Member

ToDate() function not working

I need to convert string to Date type and use it in the DaysBetween function.

Created a variable =ToDate("01/10/2010"; "dd/mm/yyyy").

The output for this becomes 01/01/2010.

What can I do to make the ToDate() function work?

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Best Answer
    Posted on Sep 21, 2010 at 04:06 PM

    As already suggested, you have to use the format =ToDate("01/10/2010"; "dd/MM/yyyy") as mm stands for minutes.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      In my case it doesn't work though it's yyyy/MM/dd. Below is the scenario.

      The reports required to show currentdate as a column in date format as yyyy/MM/dd (Eg: 2015/06/18). As the BO locale is UK, currentdate returns 18/06/2015.

      The date is then converted using Formatdate as below, that returns a string

      Formula:

      =Formatdate(Currentdate();"yyyy/MM/dd")

      Output: String

      2015/06/18

      Now we need it as date, so here's what I did.

      Formula:

      =ToDate(Formatdate(Currentdate();"yyyy/MM/dd");"yyyy/MM/dd")

      Output: Date

      18/06/2015

      Any good suggestions please?

  • author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2010 at 11:26 AM

    I guess the date format in BO is "dd/MM/yyyy". mm represents the minutes in web-I.

    Hope this helps you.

    Regards,

    Rohit

    Add comment
    10|10000 characters needed characters exceeded