Forum Discussion

ouafaa's avatar
ouafaa
Helper II
8 years ago

error when trying to filter a datetime column

I had this error when i tried to filter a table by a datetime column : ( I want just data with the value of the datetime column > 14/02/2015 07:14:00

 

 

DataSource.Error : Microsoft SQL : La conversion d'un type de données CHAR en type DATETIME a donné une valeur hors limite de date et d'heure.
Détails :
    DataSourceKind=SQL
    DataSourcePath=localhost;mydatabase
    Message=La conversion d'un type de données CHAR en type DATETIME a donné une valeur hors limite de date et d'heure.
    Number=242
    Class=16

 

has anyone an idea on how to solve this problem please ?

 

thanks

11 Replies

  • Seems like Data type error, I am not familiar with the spanish language. Could you please convert that error to English?

    • ouafaa's avatar
      ouafaa
      Helper II

      thanks for your quick reply

      there is the english traduction of the error i got :  (it was not spanish, it was french :) )

      DataSource.Error: Microsoft SQL: The conversion of CHAR data type to DATETIME type has given an obsolete date and time value.
      Details:
      DataSourceKind = SQL
      DataSourcePath = localhost; mydatabase
      Message = The conversion of a CHAR data type to DATETIME type has given a limit value and a time exceeded.
      Number = 242
      Class = 16

       

      thanks a lot

    • sqlguru448's avatar
      sqlguru448
      Helper III

      It seems like the column you are filtering on has data type of CHAR and the filter you are applying is DATETIME.

       

      You need to change the data type of the column you are filtering on to DATETIME.

  • v-piga-msft's avatar
    v-piga-msft
    Resident Rockstar

    Hi ouafaa,

     

    I have made a test try to reproduce your issue but every thing works  well.

     

     

    Did you have the same steps as mine?

     

    Besides, you 'd better select the value from the table rather than enter the valur manually.

     

    Best Regards,

    Cherry

    • ouafaa's avatar
      ouafaa
      Helper II

       

       

       

       

      • ouafaa's avatar
        ouafaa
        Helper II

        Hi,

         

        I think I found the problem but I still can't solve it.

         

        the problem is the format of my datetime column in the database dd/MM/yyyy hh:mm:ss

        but for power bi, does not accept when i choose to filter by > 20/10/2008 00:00:00  for exemple, because for power bi 20 is not a valable month! 

        how can I tell to power bi that my datetime column has the format dd/MM/yyyy hh:mm:ss in my database ? before importing the data.

         

        Thanks a lot for you help