maximus1974
asked on
Need to format a column within my Excel formula to be a date
I keep getting a number instead of date within my Excel formula. How can I format the field within my formula to be the same date format as the data in the TAG_DATE column? Please see the attached screenshot.
Capture.PNG
Capture.PNG
ASKER
Thank you but I am receiving the following error attached.
Capture.PNG
Capture.PNG
What I posted should directly replace H2 in the formula, i.e there should be no quotes around it.
="UPDATE STOCK SET TAGGED_BY'"&G2&"', TAG_DATE='"&TEXT(H2,"DD-MM M-YY")&"' WHERE STM_AUTO_KEY='"&B2&"';"
="UPDATE STOCK SET TAGGED_BY'"&G2&"', TAG_DATE='"&TEXT(H2,"DD-MM
ASKER
My apologies for my ignorance but I am obviously not understanding. I have removed quotes and replaced H2 with what you posted and still the same error.
Capture.PNG
Capture.PNG
Are you using a non-English version of Excel?
Try with a semicolon - and the ISO format for the date format, as you will need this in the finished SQL:
="UPDATE STOCK SET TAGGED_BY'"&G2&"', TAG_DATE='"&TEXT(H2;"YYYY-MM-DD")&"' WHERE STM_AUTO_KEY='"&B2&"';"
Result:UPDATE STOCK SET TAGGED_BY='2019-10-15' WHERE STM_AUTO_KEY = '5519696';
ASKER
Same error using the semicolon. I am using an english version of Excel 365. I have attached the Excel file.
tagzz.xlsx
tagzz.xlsx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much to both.
You are welcome!
TEXT(H2, "dd-mmm-yy")