Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trimming a field in a sql statment
Message
De
22/08/2000 01:12:18
 
 
À
22/08/2000 00:55:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00407618
Message ID:
00407621
Vues:
17
>I'm trying to do this sql statement
>SELECT item.ticket, Item.item, item.serialnr, item.cat;
> FROM item;
> where (ltrim(Item.ticket)) = temp;
>
>I need to trim all the blanks out of this character field, but it wont do it in my where statement anyone know of a way to do this?
>

Are you trying to strip out all blanks, all leading blanks, all trailing blanks, all leading or trailing blanks:

WHERE STRTRAN(item.ticket," ",'') = temp && eliminate all blanks
WHERE LTRIM(item.ticket) = temp && eliminate leading blanks
WHERE RTRIM(item.ticket) = temp && eliminate trailing blanks
WHERE ALLTRIM(item.ticket) = temp && eliminate leading and trailing blanks

The WHERE clause does not affect the output of the SQL Select fields; item.ticket will not have its contents changed for output as a result of the function applied in the WHERE.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform