1

I'm trying to export from my pervasive SQL database to Excel. the date is stored as CHAR(8) I need them in a recognized date format for Excel so that I can use date filtering. What do I have to add to my SQL Query to convert this date? I tried looking on W3schools, but couldn't really find what I was looking for.

Here is my query:

SELECT DISTINCT ORDER_HIST_LINE.INVOICE, 
ORDER_HIST_LINE.ORDER_NO, 
ORDER_HIST_LINE.ORDER_LINE, 
ORDER_HIST_LINE.CUSTOMER, 
ORDER_HIST_LINE.NAME_CUST_SHIP, 
ATG_BRW_INVENTORY.DISPLAY_PART, 
ATG_BRW_INVENTORY.DISPLAY_REV, 
ORDER_HIST_LINE.CUSTOMER_PO, 
ORDER_HIST_LINE.DATE_SHIPPED,
1
  • What have you tried? I put "CHAR(8) sql date" into my favorite search engine and found some promising leads.
    – picobit
    Mar 30, 2016 at 0:40

1 Answer 1

0

You can use instead of ORDER_HIST_LINE.DATE_SHIPPED

select ....convert(ORDER_HIST_LINE.DATE_SHIPPED, getdate(), 103)
For 103 it is the format or type of date you can choose from this example which number you need.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .