Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replacing only blank fields
Message
De
16/01/2003 19:48:44
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00742691
Message ID:
00742697
Vues:
18
>Good day everyone!
>I am trying to code a button that when pressed will look through a field and if it finds any empty fields in the table replace it with a default value.
>I was thinking something like the following but I know it's wrong:
>
>REPLACE ALL table.field with "default_value" where table.field=""

The problem here is that, if you have SET EXACT OFF, all fields will meet the condition. If you have SET EXACT ON, none will.

If you know that the character field has 10 spaces, you can use:

... where Field = space(10)

However, the easiest method is:

... where empty(Field)

This works for most data types! Characters with only blank, memos that are either empty or only blanks, numerics = 0, empty dates.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform