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 / April 2007

Tip: Looking for answers? Try searching our database.

A nice quick easy one...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
scubadiver - 29 Mar 2007 11:16 GMT
...though I'm not so sure myself!

Hello,

From the following list in a query

product

ALS
ALS/24
CDWS
CDWS/4
CDWS/OSS
CDWS/RSR
DWS
DWS/4
DWS/OSS
DWS/HER
DWS/RSR
DWS/BUNDLE

I would like just the following

ALS
CDWS
DWS

thanks
Ofer Cohen - 29 Mar 2007 12:38 GMT
In the criteria of the product you can use

In ("ALS","CDWS","DWS")

Signature

Good Luck
BS"D

> ...though I'm not so sure myself!
>
[quoted text clipped - 24 lines]
>
> thanks
scubadiver - 02 Apr 2007 09:04 GMT
Hello,

thanks for the reply. I didn't think that queries could be filtered the way
you suggested so I wasn't too clear with my question.

I don't want to filter the records, just get rid of the / and everything to
the right.

So this...

ALS
ALS/24
CDWS
CDWS/4
CDWS/OSS
CDWS/RSR
DWS
DWS/4
DWS/OSS
DWS/HER
DWS/RSR
DWS/BUNDLE
OSS/OSS

should become this...

ALS
ALS
CDWS
CDWS
CDWS
CDWS
DWS
DWS
DWS
DWS
DWS
DWS
OSS

cheers
John Spencer - 02 Apr 2007 12:59 GMT
You can use a calculated field to get the result you want.

Field: NoSlash: Left([Your TableName].[Your Field Name] & "/", Instr(1,[Your
TableName].[Your Field Name],"/")-1)

NoSlash can be replaced with the name of your field or with any other name
you want to give the calculated field.

Signature

John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.

> Hello,
>
[quoted text clipped - 39 lines]
>
> cheers
scubadiver - 02 Apr 2007 13:52 GMT
that is the kind of thing I was thinking but there is a problem. Every line
that doesn't have a "/" I am getting an "#Error"

> You can use a calculated field to get the result you want.
>
[quoted text clipped - 47 lines]
> >
> > cheers
scubadiver - 02 Apr 2007 14:18 GMT
I guess the code is assuming that every line has a "/" ??

> You can use a calculated field to get the result you want.
>
[quoted text clipped - 47 lines]
> >
> > cheers
John Spencer - 02 Apr 2007 16:40 GMT
My error,  appended the slash in the wrong place.

Field: NoSlash: Left([Your TableName].[Your Field Name] ,
Instr(1,[Your TableName].[Your Field Name] & "/","/")-1)

Signature

John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.

> I guess the code is assuming that every line has a "/" ??
>
[quoted text clipped - 52 lines]
>> >
>> > cheers
scubadiver - 03 Apr 2007 08:24 GMT
Cheers

> My error,  appended the slash in the wrong place.
>
[quoted text clipped - 57 lines]
> >> >
> >> > cheers
Michel Walsh - 29 Mar 2007 12:50 GMT
Get the basic data with something like:

SELECT product As root, (product & "/*" ) As mask
FROM tableName
WHERE NOT(product LIKE "*/*")
GROUP BY product

then, to 'replace' the product by its root:

SELECT a.*, b.root
FROM tableName As a INNER JOIN previousQuery AS b
   ON a.product LIKE b.mask

Hoping it may help,
Vanderghast, Access MVP

> ...though I'm not so sure myself!
>
[quoted text clipped - 24 lines]
>
> thanks
John Spencer - 29 Mar 2007 13:04 GMT
WHERE Product Not Like "*/*"

That should return all records that don't contain a "/"
Signature

John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.

> ...though I'm not so sure myself!
>
[quoted text clipped - 24 lines]
>
> thanks
 
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.