Forum Discussion

tebtim19's avatar
tebtim19
Icon for Helper IV rankHelper IV
5 years ago
Solved

cannot convert value of type text to type Date

I tried to combine the column Date and EndDate I have with a formula dd/mm/yy
using this Projects = ([Date] & "--" &[EndDate])
 
but it gives me an output of the combination with the formula of mm/dd/yy
 
I check the data type it is in text and when I change it to Date it gives me an error message
cannot convert value of type text to type Date  any idea? 
 
 
  • Hi tebtim19 

    There is another method you can take in Query Editor. Since the Date columns are in Text type, you can add a custom column as below.

    = [Date]&"--"&[EndDate]

     

    If you want to change the data type without an error, you can right click the column -> Change Type -> Using Locale... and set the data type as Date with origin locale.

    After that, you can add a custom column like below.

    = Date.ToText([Date])&"--"&Date.ToText([EndDate])

     

    Best Regards,

    Community Support Team _ Jing Zhang

    If this post helps, please consider Accept it as the solution to help other members find it.

2 Replies

  • Hi tebtim19 

    Not entirely clear but Either Date and / or EndDate have text that can't be converted to date.  Which column did you try changing the data type for?

    Can you share some data? Even screen shots?

    Phil

  • v-jingzhang's avatar
    v-jingzhang
    Icon for Community Support rankCommunity Support

    Hi tebtim19 

    There is another method you can take in Query Editor. Since the Date columns are in Text type, you can add a custom column as below.

    = [Date]&"--"&[EndDate]

     

    If you want to change the data type without an error, you can right click the column -> Change Type -> Using Locale... and set the data type as Date with origin locale.

    After that, you can add a custom column like below.

    = Date.ToText([Date])&"--"&Date.ToText([EndDate])

     

    Best Regards,

    Community Support Team _ Jing Zhang

    If this post helps, please consider Accept it as the solution to help other members find it.