Changing Field Properties using queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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
 
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
 
Back
Top