Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create index
Message
De
25/04/2007 07:32:09
 
 
À
25/04/2007 07:25:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01219687
Message ID:
01219689
Vues:
7
>Hi,
>I have a field1(c,10) and I'd like to create an index on it. The field looks like this: "BA12345607", and the index should consist of the last two characters showing the year, and then the six characters from the middle showing the sequential number and the first two letters showing a sequence as well.
>I've tried to join the three together like this,
>
> INDEX ON VAL(SUBSTR(ALLTRIM(field1),9,2)+SUBSTR(ALLTRIM(field1),3,8))+ SUBSTR(ALLTRIM(field1),1,2) TO indx
>
>but it didn't work. Joining the first two is ok. Can I join the three in one anyway?
>
>Thanks
>Tamas

You are trying to add or concatenate a number with a string which isn't possible. Leave out the val() function and it will work :
INDEX ON SUBSTR(ALLTRIM(field1),9,2)+SUBSTR(ALLTRIM(field1),3,8) + SUBSTR(ALLTRIM(field1),1,2) TO indx
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform