Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL equivalent to VAL not working
Message
 
À
14/08/2006 10:45:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01144926
Message ID:
01145317
Vues:
15
Tracy,

It will indeed work. Both, what you have there and what I posted do the same thing. I was confused about what the solution below was accomplishing exactly. Although, shouldn't your query below use the same pattern in both the select and where clauses?

Chad

>This seems to work:
>
>SELECT CAST(LEFT(Number, PATINDEX('%[-,A-Z]%', Number + 'A')-1) AS int), Number FROM occ_main
>   WHERE CAST(LEFT(Number, PATINDEX('%[-,/\@#$%^!&*()+A-Z]%', Number + 'A')-1) AS int) BETWEEN 302 AND 390
>
>I updated number in the table so that a few records contained the value of 311-3B or 308A in the number field and when I ran the above query it returned them as well as 302-309 plain values.
>
>It returned:
>
>
>(no column name)   number
>302                  302
>308                  308A
>311                  311
>311                  311-3B
>312                  312
>308                  308
>
>Etc which is correct.
_________________________________
There are 2 types of people in the world:
    Those who need closure
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform