Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete or filter
Message
From
16/10/2006 17:08:11
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
16/10/2006 02:10:25
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01162158
Message ID:
01162335
Views:
15
>thank you ,i found it...
>set filter to atc(trim("?"),myfiled ) > 0
>
>>hi all,
>>
>>i need help to delete or filter myfield (names), many of names have ? inside the name,
>>as mohammed ? qasem, edwa?rd ,ali al?era....etc,
>>if any record (field names) have just ? delete it,
>>
>>thanks

There are several alternatives, but in all cases, the basic condition is:
... "?" $ MyField
The at() function should also work, but the $ operator is simpler in this case. "string" $ "some longer string" means: the first string is contained within the longer string.

Alternatives for the other commands, assuming you want to delete the RECORDS:
  • For viewing (and deleting), you can use a filter. BROWSE to view, DELETE ALL or DELETE REST to delete.
  • You can use SELECT - SQL to view.
  • You can use DELETE FROM (the SQL command) to delete.

    If you want to delete the INVALID CHARACTERS but keep the remaining data, the closest to a "search and replace" is the strtran() function (but see also chrtran()):
    use MyTable
    replace all MyField with StrTran(MyField, "?", "")
    * or
    update MyTable set MyField = StrTran(MyField, "?", "")
    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)
  • Previous
    Next
    Reply
    Map
    View

    Click here to load this message in the networking platform