Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you eliminate spaces in a variable
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
How do you eliminate spaces in a variable
Miscellaneous
Thread ID:
00793254
Message ID:
00793254
Views:
50
How do you prevent spaces from being inserted into a access table when you are doing "insert into" command either throught spt or sql commmand.
For example I am trying to insert following data. The one that seems to give me problem is "A21 = 'kern61701'". I do an alltrim in sql statement (although it doesn't work with spt) and when I go and check my access database I have data as 'kern61701 ' with bunch of spaces at end. I need these spaces gone because it is used a a filename in access database. Here is my code:
A21 = 'kern61701'
.....
.....				
										
INSERT into ITCCursor (IDNumber, BadgeType, CreateDate, ChangeDate, Operator, PrintCount);
	 VALUES ((x),ALLTRIM(A21),DATE(),DATE(),"admin",0)
lnRes = TABLEUPDATE(.t.,.t.,'ITCCursor')
IF lnRes = .F. && update failed above try again directly on server table
	lcSql = "INSERT into ITCFields (IDNumber, BadgeType, "  ;
		+ " CreateDate, ChangeDate, Operator, PrintCount) " ;
		+ " VALUES (?x,?ALLTRIM(A21),DATE(),DATE(),'admin',0) " 
	lnRes = SQLEXEC(THISFORM.nCon,lcSql)
ENDIF 


Thanks
Nick Patel
Next
Reply
Map
View

Click here to load this message in the networking platform