E
eselk2003
I have table with a primary key of Long Integer type. I would like to
do a query like this:
SELECT * FROM MyTable WHERE MyKey Like "5*" ORDER BY MyKey
When I do that same query on any indexed string/text field, it returns
super-fast. I'm doing the query in VBA script and the query is a
dynaset, so it should just locate the first record and then return, so
if it is actually using the index, it should always be very fast to
find the first record.
I understand the problem is that 5* could be one of several possible
numbers, 5, 50, 500, 512, 50123, etc... so I think this makes it
impossible for Access to use the index. Is this correct, or am I
missing something?
Any way to have index keep an index by number for my normal stuff (and
the normal primary key stuff that Access likes), and also another
index for "text" type look-ups? I guess I could add another field, as
a text field, but then I would have to make sure I keep the text field
updated, so I'm not crazy about that idea, I don't like duplicate data
storage.
do a query like this:
SELECT * FROM MyTable WHERE MyKey Like "5*" ORDER BY MyKey
When I do that same query on any indexed string/text field, it returns
super-fast. I'm doing the query in VBA script and the query is a
dynaset, so it should just locate the first record and then return, so
if it is actually using the index, it should always be very fast to
find the first record.
I understand the problem is that 5* could be one of several possible
numbers, 5, 50, 500, 512, 50123, etc... so I think this makes it
impossible for Access to use the index. Is this correct, or am I
missing something?
Any way to have index keep an index by number for my normal stuff (and
the normal primary key stuff that Access likes), and also another
index for "text" type look-ups? I guess I could add another field, as
a text field, but then I would have to make sure I keep the text field
updated, so I'm not crazy about that idea, I don't like duplicate data
storage.