Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2005

Tip: Looking for answers? Try searching our database.

Wild card in query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Akrt48 - 30 Nov 2005 15:58 GMT
I have a table I am trying to query I want to return all rows with H* and
convert them to other text in my column, here is the query, can't figure out
what I am doing wrong.  
iif([field]="h*","handy",iif([field]="t*","tell",null))  I have tried it with
h* no asteriks but it doesn't work.  Is this possible to do?
Allen Browne - 30 Nov 2005 16:15 GMT
Use the Like operator with wildcards:
   IIf([Field] Like "h*", ...

If you are trying to replace the leading h with a leading t, you would need
to use the Criteria of:
   Like "h*"
and in the Update row of the query:
   "t" & Mid([Field], 2)

The Replace() function might also be useful.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I have a table I am trying to query I want to return all rows with H* and
> convert them to other text in my column, here is the query, can't figure
[quoted text clipped - 3 lines]
> with
> h* no asteriks but it doesn't work.  Is this possible to do?
John Spencer - 30 Nov 2005 16:53 GMT
Allen I misread your reply, so if you will allow me to expand on your first
answer.

IIF([field]Like "h*","handy",IIF ([field] LIKE "t*","tell",null))

> Use the Like operator with wildcards:
>    IIf([Field] Like "h*", ...
[quoted text clipped - 14 lines]
>> with
>> h* no asteriks but it doesn't work.  Is this possible to do?
Akrt48 - 30 Nov 2005 19:19 GMT
Thank you Allen worked perfectly!

> Use the Like operator with wildcards:
>     IIf([Field] Like "h*", ...
[quoted text clipped - 14 lines]
> > with
> > h* no asteriks but it doesn't work.  Is this possible to do?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.