Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sorting addresses w/PO Boxes treated numerically
Message
From
17/08/2006 02:38:46
Jill Derickson
Software Specialties
Saipan, CNMI
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Sorting addresses w/PO Boxes treated numerically
Environment versions
Visual FoxPro:
VFP 9 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01146266
Message ID:
01146266
Views:
56
Hi all,

I'm looking for advice, before i reinvent the wheel, about creating an index on an address field for a temporary table, so that PO boxes will sort by their numeric value, for instance:

1234 Terrice Drive
P. O. BOX 1
P. O. BOX 3
P. O. BOX 3 PPP
P. O. BOX 3 Quartermaster Road
P. O. BOX 4
P. O. BOX 10

etc.

The PO Box addresses are guaranted to start with "P. O. BOX"

I can sort properly all numeric only PO Box addressess, with:

INDEX on IIF( mas_address1 = "P. O. BOX", "P. O. Box " + padl(INT(VAL(SUBSTR(mas_address1, 10))),10), mas_address1) TO testnew

But the addresses with text after the number give me trouble.

Anyone already doing this?

TIA! J
Next
Reply
Map
View

Click here to load this message in the networking platform