Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query to change the type of a field.

Status
Not open for further replies.

mystuff

Programmer
Apr 30, 2004
86
US
Hi,

I import an excel spreadsheet to a table everyday that has a field formatted as "text", but contains a "number" value. The number comes in with a space in front of it. Every day I manually remove the space by going into the design view, changing the format of the field from "text" to "number" and clicking "save". (This also gets rid of records that have a blank or null in the field which is what I want too.) I would like to accomplish this in a query or using vbasic. Does anyone know the best way to do this? Thanks.
 
Please do not ddouble post across forums :D

CLng(myfield)

------------------------
Hit any User to continue
 
OK, but the question was a Visual Basic question and a Query question, so I wasn't sure where to post it. Sorry about that.
 
The same function can be used in both VB(A) and your query.. :D

------------------------
Hit any User to continue
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top