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

filling either a character field or numeric field

Status
Not open for further replies.

gfath

Technical User
Jan 14, 2007
2
A2
using visual foxpro6 and have a 13space field that holds
upc code.. some of the upc codes only have 11 characters.
need to put zero,s in front of the code that don't have 13
characters.
example ( 12345678911) of what i have
need (0012345678911) tha database has 75000 records
can either be character or numeric field
 
You can't pad numeric values in a table, but you can display them however you like in controls using TRANSFORM or the mask property of the control.

e.g.
?PADL(ALLTRIM(TRANSFORM(123.45,'##########.##')),13,"0")

Brian
 
Something like a UPC code should be a character field, not numeric. Use numeric fields when you might need to do arithmetic. Otherwise, use character fields, even when the data consists only of digits.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top