houseofturner
Registered User.
- Local time
- Today, 16:51
- Joined
- Dec 10, 2009
- Messages
- 37
I am obviously being really stupid by the query below compiles ok but when I run it I get a syntax error. Its a long query so it is split up with " & _
Any help would be appreciated....
DoCmd.RunSQL ("SELECT [Bounce Backs To Process - Imported].ID, [Bounce Backs To Process - Imported].Contents AS Notes, Right(Left([Bounce Backs To Process - Imported]![Contents],InStr(1,[Bounce Backs To Process - Imported]![Contents],""@"",10)),Len(Left([Bounce Backs To Process - Imported]![Contents],InStr(1,[Bounce Backs To Process - Imported]![Contents],""@"",10)))-InStrRev(Left([Bounce Backs To Process - Imported]![Contents],InStr(1,[Bounce Backs To Process - Imported]![Contents],""@"",10)),"" "")) & Left(Mid([Bounce Backs To Process - Imported]![Contents],InStr(1,[Bounce Backs To Process - Imported]![Contents],""@"",100)+1),InStr(Mid([Bounce Backs To Process - Imported]![Contents],InStr(1,[Bounce Backs To Process - Imported]![Contents],""@"",100)+1),"" "")) AS Email " & _
"FROM [Bounce Backs To Process - Imported] " & _
"WHERE (((Bounce Backs To Process - Imported.Contents) Like ""*not able to deliver*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*not been delivered*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*permanent error*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*could not be delivered*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*failed*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*Will not retry*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*not recognized*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*unrecoverable error*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*undeliverable*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*no user by that*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*I have now left*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*incorrectly addressed*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*Sorry it didn't work out*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*permanent fatal*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*did not reach*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*doesn't exist*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*no such user*""));")
Any help would be appreciated....
DoCmd.RunSQL ("SELECT [Bounce Backs To Process - Imported].ID, [Bounce Backs To Process - Imported].Contents AS Notes, Right(Left([Bounce Backs To Process - Imported]![Contents],InStr(1,[Bounce Backs To Process - Imported]![Contents],""@"",10)),Len(Left([Bounce Backs To Process - Imported]![Contents],InStr(1,[Bounce Backs To Process - Imported]![Contents],""@"",10)))-InStrRev(Left([Bounce Backs To Process - Imported]![Contents],InStr(1,[Bounce Backs To Process - Imported]![Contents],""@"",10)),"" "")) & Left(Mid([Bounce Backs To Process - Imported]![Contents],InStr(1,[Bounce Backs To Process - Imported]![Contents],""@"",100)+1),InStr(Mid([Bounce Backs To Process - Imported]![Contents],InStr(1,[Bounce Backs To Process - Imported]![Contents],""@"",100)+1),"" "")) AS Email " & _
"FROM [Bounce Backs To Process - Imported] " & _
"WHERE (((Bounce Backs To Process - Imported.Contents) Like ""*not able to deliver*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*not been delivered*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*permanent error*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*could not be delivered*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*failed*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*Will not retry*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*not recognized*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*unrecoverable error*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*undeliverable*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*no user by that*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*I have now left*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*incorrectly addressed*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*Sorry it didn't work out*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*permanent fatal*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*did not reach*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*doesn't exist*"" " & _
"Or (Bounce Backs To Process - Imported.Contents) Like ""*no such user*""));")