• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

SQL statements using Excel - Date Formatting issue

ismail

New Member
="update table_name set colum_name_1="&F2&" where column_name_2='"&A2&"' and column_name_3='"&C2&"';"


How do I get the update sql string to work, if the column is date type.

I tried to format the date columns in the specific format that sql understands ‘yyyy-mm-dd’

but when I build the string and reference the date it gives me rubbish formatted data. is there a way to overcome this ?

thanks
 
Hi, Ismail!


First of all welcome to Chandoo's website Excel forums. Thank you for your joining us and glad to have you here.


And about your question...


Can you please try the below for me.. :)

="update table_name set colum_name_1="&TEXT(F2,"yyyy-mm-dd")&" where column_name_2='"&A2&"' and column_name_3='"&C2&"';"


Don't forget to ROLLBACK if you need any further assistance.. :)


Regards,

Deb
 
Hello Deb,


I am really glad that I have joined this site, you have some wonderful tips and tricks; which make Excel fun.


Thanks a lot for the above solution that worked like a charm... :)


Best Regards

Ismail.
 
Back
Top