Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stumped on SQL
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01063164
Message ID:
01063175
Views:
9
This message has been marked as the solution to the initial question of the thread.
>OK - here's the situation:
>
>I have a table with a field, dealnumber, that could contain the following values (as examples):
>
>ATP-SP
>ATP-SP2
>ATP-SP19
>BP-SP
>BP-SP2
>BP-SP19
>
>I would like to select and group the data by the portion of the deal number that goes up to "SP" (i.e. ATP-SP, BP-SP). I initially attacked this by using LEFT() and AT() as follows:
>
>
>SELECT LEFT(DealNumber, AT("-SP", DealNumber)+2) AS TrimmedDeal
>
>

Try wrapping LEFT() in PADR() so you don't have issues based on the first record in the list.

Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform