Query to table Data type changes

neilb

Board Regular
Joined
Apr 18, 2002
Messages
128
Hi

I have created a query that puts the date and time together to form a general date format by using a format([date] & " " & [time],"general date") FORMULA. I have also set the properties to show as generaldate in the make table query.

When I run the query it creates the table but makes the date and time field a text data type. If I correct it in the table and then re run the query it makes it a text again.

Am I missing something to stop this happening
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
The format function returns a String ie Text.

If I correct it in the table and then re run the query it makes it a text again

What type of query?

ASFAIK the only query that could change a datatype is a Make Table query.
 
Upvote 0
Neil

I don't know if it would work but why not create a table with the fields the data type you want.

Then change the make table to and append query to the new table.

Also take a look at the CDate type conversion function.

eg CDate(Format([date] & " " & [time],"general date") )
 
Upvote 0

Forum statistics

Threads
1,221,814
Messages
6,162,135
Members
451,744
Latest member
outis_

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