Filter out rows including a phrase

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

Guest

1. I have a column with comments in text fomat.
A cell may include many different comments, and I want to filter out all the
ones including the comment "SiktZ>maxZ", even if it is surrounded by other
comments within the same cell.

Is there a command meaning "including"? What is the abbreviation for it and
what (if not obvious) does that abreviation stand for (so that I can find the
translated version of the command on my Swedish Access-version)

2. Is there a translation table for translated commands between different
laguage versions of Access? An English - Swedish would be very helpful!! A
complete list of what the commands mean would be even better.
 
Just got an idea how to solve the problem with "mixed comments".
Most comments are separated by a comma (,).
I could separate the comments into a column each, and then sort out the ones
I want/should be deletd.

How do I separate a text-column into several (unequal amount) of columns,
based on separation by a comma-sign?

/Johanna

"Johanna" skrev:
 
Use the Split function to get each comment up to a certain number
Create a function that recieve the text and a location, and return the name
in this location within the string

Function ReturnStrPart(MyField as String,Location as Integer) as string
On error resume ReturnStrPart_Err
ReturnStrPart = Split(MyField ,",")(Location)
Exit Function
ReturnStrPart_Err:
ReturnStrPart = ""
End Function

Now, use this function in the query

Select ReturnStrPart(FieldName,0) As comments1, ReturnStrPart(FieldName,1)
As comments, ReturnStrPart(FieldName,2) As comments3 From TableName
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck
 
If you want to filter out the entire record then use the criteria

NOT LIKE "*SiktZ>maxZ*"

If you want to display all the comments in the field except the portion that
is "SiktZ>maxZ" then you probably want to use the Replace function (Access
2002 and later, with Access 2000 there is a workaround).
 
Back
Top