grouping by using a word contained in field

  • Thread starter Thread starter season
  • Start date Start date
S

season

I need to create a query to bring out certain data by a word it contains.

Example
VALLEY_VA04
VALLEY_VA05
Trussville_TR01

i would need to only query out the rows containing Valley. Just to note,
the Valley fields with have different letters and number after the _ mark,
and Not all rows contain the word Valley. I have tried the InStr i have seen
on this disscusion board, but it is not working. Here is what i have tried.

Like Left([Final Data]![Meter],InStr(1,[Final Data]![Meter], "Valley", 1)+5

Please Help, THanks
 
season said:
I need to create a query to bring out certain data by a word it contains.

Example
VALLEY_VA04
VALLEY_VA05
Trussville_TR01

i would need to only query out the rows containing Valley. Just to note,
the Valley fields with have different letters and number after the _ mark,
and Not all rows contain the word Valley. I have tried the InStr i have seen
on this disscusion board, but it is not working. Here is what i have tried.

Like Left([Final Data]![Meter],InStr(1,[Final Data]![Meter], "Valley", 1)+5


How about just:

Like "Valley_*"

If you then want the stuff after the Valley_, use:
Mid(Final Data.Meter, 8)
 
Thanks, something so simple i try to make complicated. i did try the like
function earlier, but left out the*, so it did not work. Thanks so much

Marshall Barton said:
season said:
I need to create a query to bring out certain data by a word it contains.

Example
VALLEY_VA04
VALLEY_VA05
Trussville_TR01

i would need to only query out the rows containing Valley. Just to note,
the Valley fields with have different letters and number after the _ mark,
and Not all rows contain the word Valley. I have tried the InStr i have seen
on this disscusion board, but it is not working. Here is what i have tried.

Like Left([Final Data]![Meter],InStr(1,[Final Data]![Meter], "Valley", 1)+5


How about just:

Like "Valley_*"

If you then want the stuff after the Valley_, use:
Mid(Final Data.Meter, 8)
 
Back
Top