Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Index on VarChar field
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01459589
Message ID:
01459618
Views:
32
You get what you're asking for. See http://www.berezniker.com/content/pages/visual-foxpro/string-comparison-vfp
You should use LIKE operator in this case. It'll work in VFP and other DBs
SELECT * FROM Test WHERE LOWER(LEFT(cSubject,30)) LIKE "abc%"
>I seem to be experiencing index problems with a VarChar field, has anyone else ever encountered similar behaviour with this field type.
>
>
>CREATE TABLE Test ( ;
>	iTimeId I PRIMARY KEY, ;
>	nParentId I, ;
>	cSubject V(80), ;
>	)
>ALTER TABLE Test
>INDEX ON DELETED() TAG Deleted
>INDEX ON LOWER(LEFT(cSubject,30)) TAG cNormSub
>
>
>Then run
>
>SELECT * FROM Test WHERE LOWER(LEFT(cSubject,30)) = "abc"
>
>Which not only returns records beginning 'abc' but also includes those where cSubject is blank! From what I can establish issuing a REINDEX appears to cure the problem.
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform