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

Format from excel into foxpro ?

Status
Not open for further replies.
Oct 21, 2006
20
0
0
US
HELLO,

I am trying to get a field of social security numbers from excel into a foxpro table. At first I make the table in excel a Text format and I imported it into foxpro. The Numbers are in the middle of the character field (25) in foxpro. Now when I try to make it a numeric format (25) the numbers disappear.

Someone see where I am doing this wrong.

Charlesmac
 
No such thing as numeric 25. VFP limits numeric to 20.

Are there characters in your field?

Try:

Code:
CREATE TABLE test (ssn c(25))
INSERT INTO test VALUES (SPACE(8)+"012345678"+SPACE(8))
INSERT INTO test VALUES (SPACE(8)+"012-34-5678"+SPACE(8))
BROWSE NOWAIT  

SELECT * FROM test INTO TABLE test2
ALTER table test2 alter COLUMN ssn n(20)
BROWSE NOWAIT 

SELECT * FROM test INTO TABLE test3
REPLACE ALL ssn WITH ALLTRIM(CHRTRAN(ssn,CHRTRAN(ssn,"0123456789",""),""))
ALTER table test3 alter COLUMN ssn n(20)
BROWSE NOWAIT

Brian
 
hello Charlesmac,

probably your excel contains a header
if you remove that,
you import to file easyly with append from aaa.xls type xls



FILIP
 
Merry Christmas,

Filip,

Good advice and I thank you for the tip.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top