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 / General 2 / May 2007

Tip: Looking for answers? Try searching our database.

Using Wildcards in a Query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Annette - 17 May 2007 13:32 GMT
I am trying to wildcard on an account number in our database.  The elements
in the account number are separated by a period (i.e. 4286.1WT.VS2). I want
to find all of the values with the VS2 ending but when I do a wildcard Like
"*VS2" I don't get any data.  I have tried several different wildcard
characters and can't seem to get it to work.  If I wildcard on Like
"4286*VS2" I don't get any data either.  It seems like the periods separating
the elements are causing problems.  Any suggestions?
Eric Blitzer - 17 May 2007 13:50 GMT
Try
Like "*"&"VS2"

> I am trying to wildcard on an account number in our database.  The elements
> in the account number are separated by a period (i.e. 4286.1WT.VS2). I want
[quoted text clipped - 3 lines]
> "4286*VS2" I don't get any data either.  It seems like the periods separating
> the elements are causing problems.  Any suggestions?
Annette - 17 May 2007 13:59 GMT
I tried it and still didn't get any data.  Any other suggestions?

> Try
> Like "*"&"VS2"
[quoted text clipped - 6 lines]
> > "4286*VS2" I don't get any data either.  It seems like the periods separating
> > the elements are causing problems.  Any suggestions?
Ofer Cohen - 17 May 2007 13:55 GMT
I tried it and it works.

It will a great help for us to help you if you'll post the SQL

Does it look like

Select * From TableName
Where FieldName Like "*VSN"

Or, try this:

Select * From TableName
Where FieldName Like "%VSN"

Signature

Good Luck
BS"D

> I am trying to wildcard on an account number in our database.  The elements
> in the account number are separated by a period (i.e. 4286.1WT.VS2). I want
[quoted text clipped - 3 lines]
> "4286*VS2" I don't get any data either.  It seems like the periods separating
> the elements are causing problems.  Any suggestions?
Annette - 17 May 2007 14:12 GMT
I must be doing something wrong.  I still can't get it to work.  Here is the
SQL.

SELECT LIFESUPPORT_CHRG_ACCT_HIER.LEVEL_IND,
LIFESUPPORT_CHRG_ACCT_HIER.CHRG_ACCT,
LIFESUPPORT_CHRG_ACCT_HIER.PARENT_CHRG_ACCT,
LIFESUPPORT_CHRG_ACCT_HIER.DESCRIPTION
FROM LIFESUPPORT_CHRG_ACCT_HIER
WHERE (((LIFESUPPORT_CHRG_ACCT_HIER.PARENT_CHRG_ACCT) Like "*" & "VS2"));

Thanks for your help.
AB

> I tried it and it works.
>
[quoted text clipped - 17 lines]
> > "4286*VS2" I don't get any data either.  It seems like the periods separating
> > the elements are causing problems.  Any suggestions?
Eric Blitzer - 17 May 2007 14:41 GMT
I tried it and it works for me

> I must be doing something wrong.  I still can't get it to work.  Here is the
> SQL.
[quoted text clipped - 30 lines]
> > > "4286*VS2" I don't get any data either.  It seems like the periods separating
> > > the elements are causing problems.  Any suggestions?
Ofer Cohen - 17 May 2007 14:51 GMT
Are you sure the filter is on the right field?.

Also try:

SELECT LIFESUPPORT_CHRG_ACCT_HIER.LEVEL_IND,
LIFESUPPORT_CHRG_ACCT_HIER.CHRG_ACCT,
LIFESUPPORT_CHRG_ACCT_HIER.PARENT_CHRG_ACCT,
LIFESUPPORT_CHRG_ACCT_HIER.DESCRIPTION
FROM LIFESUPPORT_CHRG_ACCT_HIER
WHERE (((LIFESUPPORT_CHRG_ACCT_HIER.PARENT_CHRG_ACCT) Like "%VS2"))

Signature

Good Luck
BS"D

> I must be doing something wrong.  I still can't get it to work.  Here is the
> SQL.
[quoted text clipped - 30 lines]
> > > "4286*VS2" I don't get any data either.  It seems like the periods separating
> > > the elements are causing problems.  Any suggestions?
Annette - 17 May 2007 15:01 GMT
There must be something with the actual data in my table that won't let the
wildcard work (it is set up as text).  I created another table with the data
and manually retyped one of the account numbers in the field and the wildcard
worked for that entry only.  I'll look some more at my actual data.

Thanks for your help!
AB

> Are you sure the filter is on the right field?.
>
[quoted text clipped - 41 lines]
> > > > "4286*VS2" I don't get any data either.  It seems like the periods separating
> > > > the elements are causing problems.  Any suggestions?
Ofer Cohen - 17 May 2007 14:52 GMT
One more option you can try, does it return records

SELECT LIFESUPPORT_CHRG_ACCT_HIER.LEVEL_IND,
LIFESUPPORT_CHRG_ACCT_HIER.CHRG_ACCT,
LIFESUPPORT_CHRG_ACCT_HIER.PARENT_CHRG_ACCT,
LIFESUPPORT_CHRG_ACCT_HIER.DESCRIPTION
FROM LIFESUPPORT_CHRG_ACCT_HIER
WHERE Right(LIFESUPPORT_CHRG_ACCT_HIER.PARENT_CHRG_ACCT,3)="VS2"

Signature

Good Luck
BS"D

> I must be doing something wrong.  I still can't get it to work.  Here is the
> SQL.
[quoted text clipped - 30 lines]
> > > "4286*VS2" I don't get any data either.  It seems like the periods separating
> > > the elements are causing problems.  Any suggestions?
 
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.