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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Field Type in a Query

Status
Not open for further replies.

chanman525

IS-IT--Management
Joined
Oct 7, 2003
Messages
169
Location
US
I have a make table query that is pulling information from multiple tables. The one field is pulling up to be a text field, but I need it to be a number field. I've looked in the properties of that field but I can't seem to find anything that changes it from a text field to a number field. Any help is greatly appreciated.

Thanks.

Alg
 
You may use a conversion function like Val, CLng, CDbl, CDec, ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Well, the issue with Val is that the entire string is a number, but the field has leading 0's that we're trying to eliminate. By changing it from a text field to a number field, the leading 0's disappear.

I've tried to use a delete query and an append query, but I then get a data type mismatch because it's a text field going into a number field.

 
chanman525 said:
but the field has leading 0's that we're trying to eliminate. By changing it from a text field to a number field, the leading 0's disappear.

so you eliminate the leading zeros just like you said you wanted to....what's the problem with that?

Leslie

Come join me at New Mexico Linux Fest!
 
Nothing is wrong with that, but I'm not figuring out how to exactly change it from a text field to a number field, which would make the leading 0's disappear.
 
What you said is:
1. You want to convert it into a number
2. You want to get rid of the leading zeros
3. The problem with using Val to convert it into a number is that it gets rid of the leading zeros

????????????
 
My fault, I wasn't very clear I guess. I got Int to work to change it to number.

Thanks for the help everyone.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top