Skip to main content
Question

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

  • December 14, 2022
  • 4 replies
  • 177 views

Forum|alt.badge.img+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

Padmakumar
Forum|alt.badge.img+13
  • Navigator | Tier 3
  • 785 replies
  • 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.


Forum|alt.badge.img+1
  • Author
  • Cadet | Tier 2
  • 1 reply
  • 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.

 

 


Forum|alt.badge.img+1
  • Cadet | Tier 2
  • 2 replies
  • 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
Forum|alt.badge.img+9
  • Navigator | Tier 3
  • 494 replies
  • December 14, 2022
Vamshidhar.G2 wrote:

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings