sqlexcelquotesquotation-marks

How to add single quotation around date in Excel for use in SQL?


So I have a long list of dates that I need to add single quotations around.

However I cannot figure how to add the quotes around the date. I've looked up for help but most were using double quotations.

Example:

8/13/2018 into '8/13/2018'

Some Possible solutions I've found similar are

=TEXT(A1,"\""dd/mm/yyyy\""")

produces output: "8/13/2018"

However this only puts double quotations around the date.
The usual method I've been using on everything else is

="'"&8/13/2018&"'"

output: '43325'

But this does weird things with the date.

It would be greatly appreciated if anyone can show me how to add single quotation marks around a date in Excel.


Solution

  • commenter was close but not 100%

    ="'" & TEXT(A1,"mm/dd/yyyy") & "'"
    

    8/13/2018 is month day year not day month year

    enter image description here