Question

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

  • 14 December 2022
  • 4 replies
  • 43 views

Badge +1

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

Userlevel 7
Badge +11

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.

Badge +1

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.

 

 

Badge +1

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

 

Userlevel 4
Badge +7

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.

Reply