Re: Incremental search with numbers
- From: "Paul Shapiro" <paul@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 27 Jun 2009 08:22:36 -0400
Did you try your own suggestion: WHERE Cstr([table key] LIKE "73*"? That works for me.
If you mean that you don't know how to enter that in the graphical query designer, the easiest way is to use the View menu and change to SQL view, where you can directly edit the sql statement. In graphical view, you would add a new calculated column with the Field expression being Cstr([table key], and then enter the Criterion Like "73*".
"Goldar" <Goldar@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:94B526AD-F227-4E03-9287-71FD142FAC31@xxxxxxxxxxxxxxxx
My data is defined as "number", "single","0 decimal places". These are
account numbers (6 digits). It doesn't look like there's any way to do this,
unless I can have the SQL query convert the numeric in the table for
comparison the the LIKE clause. For example, is there any way to change the
WHERE clause to read:
WHERE Cstr([table key] LIKE "73*" to find numeric data like 734210
Otherwise, I'm left with having to restructure my table and all of the
forms, reports and queries that use this table.
Thanks for your help.
"Jeff Boyce" wrote:
By the way, first are you certain that the "numeric" field is defined as a
numeric data type in the table?
Then, if you are trying to find the alphabetic character string starting
with the character "9" in a numeric field, you won't!
Take a look at wildcards (Access HELP) -- and consider something more like
(untested):
Like [Enter a digit] & "*"
Regards
Jeff Boyce
Microsoft Office/Access MVP
"Goldar" <Goldar@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AF50B7C9-3D85-44AE-AF59-0B4AC8EE60F9@xxxxxxxxxxxxxxxx
> For example, i use my incremental search and I key in a letter (say > 'A')
> and
> my program places it in a SQL query which uses a LIKE 'A*' to extract > all
> records whose key field starts with 'A'. If I then key in a 'B', my
> program
> creates a query which uses a LIKE 'AB*' to extract all records whose > key
> starts with the characters 'AB'. And so on, until I find the record I
> want.
> So far so good.
>
> Now, if my table key field is a up to 6 digits (ex. '975321'), and I > key
> in
> the first character (ex '9'), my query will try to extract records > using
> a
> LIKE '9*' operator. Since the data in my table is numeric, it will > never
> match and no records will be selected. This is my problem. Do I need to
> start
> matching from the right rather than the left? Or, is there some way I > can
> get
> the same matching effect as I do with alphabetic data?
>
> Thanks...
>
> "Jeff Boyce" wrote:
>
>> Could you provide an example of what you are trying, and how it is >> (not)
>> working the way you expect?
>>
>> Regards
>>
>> Jeff Boyce
>> Microsoft Office/Access MVP
>>
>> "Goldar" <Goldar@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:E6D694D0-B07E-484C-8A79-1192F0496D21@xxxxxxxxxxxxxxxx
>> >I have implemented an incremental search uses the LIKE operator in a
>> >query
>> >to
>> > select aphabetic data from an alphabetic fields in a table based on
>> > characters keyed in on my form. This works fine. The problem comes >> > when
>> > I
>> > key
>> > in numeric data on my screen and try to use the LIKE operator >> > against a
>> > number field in my table. I understand what's happening, but I don't
>> > know
>> > what to do about it. It seems that I need to be able to compare the
>> > keyed
>> > characters (left to right) against the same characters in my table, >> > or
>> > something like that. Does anyone have any ideas as to how to >> > accomplish
>> > this?
>> >
>> > Thanks...
>>
>>
>>
.
- References:
- Incremental search with numbers
- From: Goldar
- Re: Incremental search with numbers
- From: Jeff Boyce
- Re: Incremental search with numbers
- From: Goldar
- Re: Incremental search with numbers
- From: Jeff Boyce
- Re: Incremental search with numbers
- From: Goldar
- Incremental search with numbers
- Prev by Date: Re: Remove the selected node in a treeview (A2007)
- Next by Date: Re: Runtime Error
- Previous by thread: Re: Incremental search with numbers
- Next by thread: Re: Incremental search with numbers
- Index(es):
Relevant Pages
|