John Weller wrote on 2015-01-21: 
>  Better to use IF SEEK(mcity+mstate, 'Cities', 'City').  Mcity+mstate must
>  match index so need to be padded to same length as the index fields, I
>  wouldn't index on a trimmed field, others may disagree.  Also, suggest
SCAN
>  ENDSCAN better than DO WHILE.
>  
>  Try:
>  
>  USE h-1b_fy14_q4 ALIAS mastfile in 0
>  USE us_cities ALIAS cities in 0
>  SELECT Mastfile
>  SCAN
>       IF SEEK(mcity+mstate, 'Cities', 'City')
>                mlat = n3
>               mlng = n4
>       ENDIF
>  ENDSCAN
>  
>  Regards
>  
>  John
>  

I agree with not using trims in indexes.
>From what I've seen, if your data is similar to 
    Fargo, ND
    Minneapolis, MN

Your index may be built like
    FargoND
    MinneMN

I've actually seen VFP 9 error with a bad index when searching for
Minneapolis.

And in John's example, setting mlat and mlng will need Cities.n3 and
Cities.n4 respectfully. 



Tracy Pearson
PowerChurch Software


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to