Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trimming a field in a sql statment
Message
From
22/08/2000 01:12:18
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00407618
Message ID:
00407621
Views:
16
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform