D
DP
Could someone help with what I am sure is a simpe string function?
I have a table with values that tend to fall into the falling three kinds of
formats in the field keywords:
1) xxxxx- xxxxxx - xxxxx - xxxx
2) xxxx, xxxx, xxxxx, xxxxx
3) xxxx xxxxx
I'm trying to query this table in order to get
1) all the distinct rows that begin with xxxxx - (so that the first word
plus " - ") will be fetched
2) return all the other distinct rows with the FULL contents of the row.
I have the code that will filter the table to distinct "xxxxx - " rows using
this kind of function in the query:
"SELECT DISTINCT Left([Keyword],InStr([keyword],' - ')) AS Groupkey FROM
tblKeywordMasterOR"
But I need a similar line of code for a second query (which I will combine
in a UNION with the first) to fetch ALL the other rows in the table as long
as they have no " - " anywhere in the string.
Can someone help me? It seemed simple, but I can't seem to get anywhere -
the code just needs to give me the FULL line as long as there is no " - " in
it. There is no looping code necessary.
Help would be appreciated.
David Pike
I have a table with values that tend to fall into the falling three kinds of
formats in the field keywords:
1) xxxxx- xxxxxx - xxxxx - xxxx
2) xxxx, xxxx, xxxxx, xxxxx
3) xxxx xxxxx
I'm trying to query this table in order to get
1) all the distinct rows that begin with xxxxx - (so that the first word
plus " - ") will be fetched
2) return all the other distinct rows with the FULL contents of the row.
I have the code that will filter the table to distinct "xxxxx - " rows using
this kind of function in the query:
"SELECT DISTINCT Left([Keyword],InStr([keyword],' - ')) AS Groupkey FROM
tblKeywordMasterOR"
But I need a similar line of code for a second query (which I will combine
in a UNION with the first) to fetch ALL the other rows in the table as long
as they have no " - " anywhere in the string.
Can someone help me? It seemed simple, but I can't seem to get anywhere -
the code just needs to give me the FULL line as long as there is no " - " in
it. There is no looping code necessary.
Help would be appreciated.
David Pike