converting data type text to date/time

C

cathy

I'm a new user of access and if I run a query to make a table and use format to truncate the date fields to remove the time element the resulting table sets the data type as text. Rather than having to manually change these back to date/time how can I run a query to automate this process?
 
D

Douglas J. Steele

There's no need to use Format. The DateValue function will retrieve strictly
the date portion, while the TimeValue function will retrieve strictly the
time portion.

Unless there's an overwhelming reason not to, my advise would be to leave
the value the way it is, and create a query based on the table that has a
calculated field using the DateValue function. Use the query wherever you
would otherwise have used the table. That way, you still have the time
available to you should you need it in the future.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



cathy said:
I'm a new user of access and if I run a query to make a table and use
format to truncate the date fields to remove the time element the resulting
table sets the data type as text. Rather than having to manually change
these back to date/time how can I run a query to automate this process?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top