Changing Field Properties using queries

S

stag246

I have a table which i am running a query from which is linked by ODBC. there
are many fields in the table. I am pulling 6 of them out of this table using
a query. Id, totime, fromtime, empID, earncode, distcode. The totime and
fromtime are both have text properties. Is there a way to use a query to
change those to a time/date property and put them in a table I would create
locally to this DB?

Thanks

Jeremy
 
T

Ted Allen

Hi Jeremy,

If you just want to coerce the value to a different data type on your end
(and not modify the ODBC connected table itself), you should be able to use
the CDate() function to return a date data type rather than text. Just enter:

CDate([YourFieldName])

as the field value in the query.

HTH, Ted Allen
 
S

stag246

thanks ted that did the trick

Ted Allen said:
Hi Jeremy,

If you just want to coerce the value to a different data type on your end
(and not modify the ODBC connected table itself), you should be able to use
the CDate() function to return a date data type rather than text. Just enter:

CDate([YourFieldName])

as the field value in the query.

HTH, Ted Allen

stag246 said:
I have a table which i am running a query from which is linked by ODBC. there
are many fields in the table. I am pulling 6 of them out of this table using
a query. Id, totime, fromtime, empID, earncode, distcode. The totime and
fromtime are both have text properties. Is there a way to use a query to
change those to a time/date property and put them in a table I would create
locally to this DB?

Thanks

Jeremy
 
T

Ted Allen

My pleasure, glad it helped.

stag246 said:
thanks ted that did the trick

Ted Allen said:
Hi Jeremy,

If you just want to coerce the value to a different data type on your end
(and not modify the ODBC connected table itself), you should be able to use
the CDate() function to return a date data type rather than text. Just enter:

CDate([YourFieldName])

as the field value in the query.

HTH, Ted Allen

stag246 said:
I have a table which i am running a query from which is linked by ODBC. there
are many fields in the table. I am pulling 6 of them out of this table using
a query. Id, totime, fromtime, empID, earncode, distcode. The totime and
fromtime are both have text properties. Is there a way to use a query to
change those to a time/date property and put them in a table I would create
locally to this DB?

Thanks

Jeremy
 

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