Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 641
Weisheng Wu Avatar asked Oct 27 '25 03:10

Weisheng Wu


1 Answers

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

like image 83
learnAsWeGo Avatar answered Oct 29 '25 17:10

learnAsWeGo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!