Avatar of tranvangiang17
tranvangiang17

asked on 

How to write a MS Access query to convert a "number" field into "text" field

Since the “Number” field can not have leading zero’s; I have to convert (or update) the original “Numbers” and place them on a new text field; please kindly help me to:

First Issue: How to write a query to add a new text field with 6-Char long to the Test table.  Is it possible with query? or we have to use VBA for this adding?  If NOT, please guide us via VBA code to add 6-char long text field.

Second issue: How to write a query to convert a 4-digit numbers (i.e. “3040”) to 6-Char long text which contain 4-digit values with 2 padded Zero’s (i.e. “003040”)

Please see the attached filed for better picture.

Thanks.

Van

Sample-tables.doc
Microsoft AccessSQL

Avatar of undefined
Last Comment
tranvangiang17
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of Norie
Norie

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
SOLUTION
Avatar of HainKurt
HainKurt
Flag of Canada image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
SOLUTION
Avatar of HainKurt
HainKurt
Flag of Canada image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of tranvangiang17
tranvangiang17

ASKER

Hi all:


Thank you.  You guys are my true hero.

I tested and found it is working OK, actually, with all solutions (of mbizup:, imnorie:, HainKurt:)

Until next time.

Van
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo