Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Looking for dates
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00700961
Message ID:
00701021
Vues:
26
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--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform