date time stamp converting to number when used in formula

ambuj33

New Member
Joined
Apr 13, 2018
Messages
4
Hello,

I am in a situation where I am making a sql query by using the columns in excel, out of which 1 column contains date time as 2017-06-13 13:18:18 PM and whenever I used this column in formula it reflects as 42899.554375.

="INSERT INTO ORDERS("&A1&","&B1&","&C1&","&D1&","&E1&") VALUES ("&A2&","&B2&",'"&C2&"','"&D2&"','"&E2&"')"

This is the formula I am making where B2 contains date.

Please assist.

TIA
Ambuj S



<tbody>
</tbody>
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Try this :

="INSERT INTO ORDERS("&A1&","&B1&","&C1&","&D1&","&E1&") VALUES ("&A2&","&
TEXT(B2,"yyyy-mm-dd hh:mm:ss AM/PM")&",'"&C2&"','"&D2&"','"&E2&"')"
 
Upvote 0

Forum statistics

Threads
1,216,499
Messages
6,131,010
Members
449,613
Latest member
MedDash99

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top