|
| |
|
|
swoosh
Posts: 1438 Joined: 5/18/2002 From: Beaver Falls, PA Status: offline
|
Sort Possible? - 8/11/2008 18:37:25
Is it possible in anyway to sort a database grid on a web page by the following: On the page now is standard properties with addresses and so forth. The address field is like "1234 Grant Street". The info is sorted by this field but now the client wants it so that it is sorted by street first and then by number. If there is no separate field for the street is this even possible? Example Now: 123 Grant Street 123 Fifth Avenue 124 Grant Street They want all the streets together unlike the above
_____________________________
Swoooosh Just Do It!
|
|
|
|
ou812
Posts: 1601 Joined: 1/5/2002 From: San Diego Status: offline
|
RE: Sort Possible? - 8/11/2008 19:26:57
I think it is pretty tough to do with the variations of address formats, especially if you have out of US address too. To get a sorting down, you should break the address down to it's basic components, at least for the street address portion - Number, Direction, Street, Type. And then allow directions and types to be of one format. (Always E or East, or always Dr. or Drive etc.) So if you're storing the addresses in one column in your database right now it is going to be pretty difficult to sort them nicely. You may have addresses entered as these: 123 E. Grant Street 123 Grant Drive 123 W. Grant Way 123 East Grant St. 123 West Grant Wy 123 Grant Dr. And then if they start putting suites or apartment numbers in on the lines might make it more difficult. You would need to think about how you would sort things like the above. Keeping the components in different columns and only allowing a set way to enter data would make it easier.
_____________________________
-brian EnterpriseDB: Enterprise-class relational database management system PostgreSQL: The world's most advanced open source database
|
|
|
|
swoosh
Posts: 1438 Joined: 5/18/2002 From: Beaver Falls, PA Status: offline
|
RE: Sort Possible? - 8/11/2008 19:33:35
As I suspected Brian. Thank you for replying
_____________________________
Swoooosh Just Do It!
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Sort Possible? - 8/15/2008 10:14:52
<$.02> Might that still work tho? Wouldn't E. Grant St be different than Grant St? (But of course also different than East Grant St.) I think a Regular Expression might be able to do that. It would at least be able to filter out all the non-alpha characters for a sort. I don't think you'd be able to put it in an SQL statement, but an array and a RegExp function you could. Just a guess. </$.02>
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
pd_it_guy
Posts: 191 Joined: 3/4/2008 Status: offline
|
RE: Sort Possible? - 8/15/2008 10:41:36
I suppose there is another way, still. -1234 E Grant St is the exact same place as -1234 East Grant St, and the exact same place as -1234 E. Grant St Sorting non standardized data is not really the issue, it is the non-validated free-form addresses that are going in. The data is bad. Would the client allow (or would you consider) the addresses be standardized, so that at some point EVERY address for East Grant is uniform. Sort of like a Master Name Index. We want all the John Jones that are turly the same person to be the exact same and not variations. It would have to be a clean up function run by the dba. I think an vb REPLACE (a string within a string) kind of function would do. I dont have a db and server handy right now so I can't be much more helpful. Others would know exactly how to do it. my .02 worth this morning
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|