Forum Discussion

patri0t82's avatar
patri0t82
Post Patron
5 years ago
Solved

Error Querying Folders of CSV Files Containing Date Column

Hello, I am querying a SharePoint / Teams folder that contains hundreds (if not thousands) of CSV files. There is a TimeStamp field that contains a value 1/1/0001 12:00:00 AM several times in each f...
  • edhans's avatar
    edhans
    5 years ago

    When you are combining the files in SHarePoint to load, it is doing an automatic Changed Type step. and all of those 0001's  are blocking it.

     

    I assume you are using the SharePoint File Combine operation. Disable the Type Detection. Then reconnect and recombine the files.

    In the Transform Sample query that would be done, make sure there is a Promote First Row as Headers step.

    Additionally, you could do a find/replace here too. FInd that time stamp and either replace it with null (all lower case - it is a special keyword - or replace it with a legit date. 

    Then change the data types.

     

    Whatever is done in the Transform Sample File step is done for each file separately before it is passed and added to the Query1 query - the real query you will use in your data source.

    What I suspect was happening is it combined some files, the first file was good so it said "That is a date column" but then when it tried to change the type of the 0001 dates, it created an error.

    At this point, you should be able to go back to your main query and have no errors - at least now with this particular field.