Update query

S

Stuart

I have a database that someone else created and that I can't change table
properties in due to it's permissions. There is a Date of Birth (DOB)
field in it that is in text format but entries look like they are in the
short date format dd/mm/yyyy. I can't run parameter queries like between
[start date]and[end date] against it because the DOB field is in text
format. I've created a make table query that selects the data that I need
with the DOB field and save it to another table that I can change
properties in.

Does anyone know how to write an update query that I could put in a macro
and that would change the text format of the DOB field in the make table to
a short date format?

Thanks,

Stuart
 
B

Brian Bastl

try bringing the DOB into the grid and then wrapping it with CDate([DOB]).
then you should be able to use your criteria.

Brian
 
G

Guest

CDate has one little problem in that it will bomb if any record can not be
evaluated as a date. I highly recommend running a query using IsDate against
the text field. If any records can't be evaluated as a date, IsDate will
return 0. Then you can fix those problem text dates.
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Brian Bastl said:
try bringing the DOB into the grid and then wrapping it with CDate([DOB]).
then you should be able to use your criteria.

Brian


Stuart said:
I have a database that someone else created and that I can't change table
properties in due to it's permissions. There is a Date of Birth (DOB)
field in it that is in text format but entries look like they are in the
short date format dd/mm/yyyy. I can't run parameter queries like between
[start date]and[end date] against it because the DOB field is in text
format. I've created a make table query that selects the data that I need
with the DOB field and save it to another table that I can change
properties in.

Does anyone know how to write an update query that I could put in a macro
and that would change the text format of the DOB field in the make table to
a short date format?

Thanks,

Stuart
 

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

Similar Threads


Top