Parameter Query and Like Condition

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello All,
I am trying to create a lookup where the user is prompted to enter in a
person's last name [Enter the Last Name] and then i would also like to search
for similar values. Such as: If a user searches "Smit" then "Smith" will
come up. I tried entering in the following:

Like*[Enter the Date]

however, it did not work. Any ideas?

Thanks in advance,
Rob
 
Hello All,
I am trying to create a lookup where the user is prompted to enter in a
person's last name [Enter the Last Name] and then i would also like to search
for similar values. Such as: If a user searches "Smit" then "Smith" will
come up. I tried entering in the following:

Like*[Enter the Date]

however, it did not work. Any ideas?

Thanks in advance,
Rob

To find records that BEGIN with the entered name
Like [Enter Name] & "*"

To find records that END with the entered name
Like "*" & [Enter Name]

To find records with the entered name ANYWHERE in the field
Like "*" & [Enter Name] & "*"
 
Rob:
Rather than using the LIKE command, try using the Left command if you know
the exact number of characters - it will run a lot faster

Your LIKE syntax is wrong in that a string is expected:

LIKE [Enter Name]&"*"
 
Try this instead, adding the * char after the parameter

Like "*" & [Enter the Last Name] & "*"
 
Now, ... either you got a strange way of asking the user for (part of) a
name by the prompt "[Enter the Date]"; or (more like) you are trying to use
Like on a Date field different from the "Last Name" Field you referred to.
However, if it is the later case, I think you managed to confuse all the
respondents so far.

You cannot use Like on numeric Field (and a Date Field is numeric under the
hood). Like is a *String* operator. It doesn't make any sense in comparing:

17/Jun/2005 Like 17/Jun/2005 18:00

, does it?
 
Back
Top