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
[TABLE="width: 159"]
<tbody>[TR]
[TD="class: xl65, width: 159, align: right"]

[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
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,223,911
Messages
6,175,335
Members
452,636
Latest member
laura12345

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