Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Looking for dates
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00700961
Message ID:
00701021
Views:
25
Assuming that it's character field, you can do somethiig like
lcStr = [I do not want to wipe out the whole field just the date. ] + ;
 		[am looking for a program or procedure that looks for dates in a field and removes them.] + ;
		[ex. 12/12/2002 12-3-2001 1/2/2002 ] + ;
		[I do not want to wipe out the whole field just the date.]

lnWord = 1
lnWordCount = GETWORDCOUNT(lcStr)
DO WHILE lnWord <= lnWordCount 
	lcWord = GETWORDNUM(lcStr, lnWord)
	IF NOT EMPTY(CTOD(lcWord ))
		lcStr = STRTRAN(lcStr, lcWord, "")
		lnWordCount = GETWORDCOUNT(lcStr)
	ELSE
		lnWord = lnWord + 1	
	ENDIF
ENDDO
You'll have to adjust this code to fit your requirements.

>Hi all:
>
>I am looking for a program or procedure that looks for dates in a field and removes them.
>ex.
>12/12/2002
>12-3-2001
>1/2/2002
>
>I do not want to wipe out the whole field just the date.
>
>Thanks
>PM
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform