Skip to main content
Cadet | Tier 2
December 14, 2022
Question

excel as db in giving date in wrong format in the output csv

  • December 14, 2022
  • 4 replies
  • 260 views

Date in the excel is in dd-MMM-yyyy format but the select query is giving the it in wrong format like 44803.

    4 replies

    Padmakumar
    Premier Pathfinder | Tier 7
    Premier Pathfinder | Tier 7
    December 14, 2022

    Hi @Vamshidhar.G2 ,

     

    Check whether the Excel file is in use or not while the DB action is carrying out. If yes, please close it and try again. Else, you can assign the Date to a String and then to a Date variable. From there, convert the format to the desired one through Date to String action and finally put it in your Insert query.

    Padmakumar
    Cadet | Tier 2
    December 14, 2022

    Hi @Padmakumar , thanks for responding. I have found the solution. Issue happened as the excel file was opened while running the DB command. When I closed it and ran the query, the date value is coming in the correct format now.

     

     

    Cadet | Tier 2
    December 14, 2022

    Try formatting the date in excel using vb script or python in input excel and then fetch it using excel as a database. 

     

    Raul Jaimes
    Navigator | Tier 3
    December 14, 2022

    Date in the excel is in dd-MMM-yyyy format but the select query is giving the it in wrong format like 44803.

    It’s easier change the Excel datatype column in the spreadsheet to Custom format.