Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid Procedure Call Error??

Status
Not open for further replies.

calihiker

Technical User
Jun 13, 2003
96
US
Here's the sql...

What is wrong with this??

SELECT "CP" & [ID] AS [ID#], profile.Email, IIf(Mid(,Len([Email])-
2,1)=".",Right([Email],Len([Email])-(Len([Email])-2)),"") AS [COUNTRY
PREFIX], profile.Country
FROM profile
WHERE (((profile.Email) Like "*@*" And (profile.Email) Is Not Null) AND
((IIf(Mid([Email],Len([Email])-2,1)=".",Right([Email],Len([Email])-(Len
([Email])-2)),"")) Not In
("ad","at","au","be","ch","cy","cz","de","dk","ee","es","fi","fo","fr","fx"
,"gb","gl","gr","hr","hu","ie","is","it","li","lt","lu","lv","mc","nl","no"
,"nz","pt","ro","se","si","sk","uk","va","yu")) AND ((profile.Country) Not
In ("uk","united kingdom","United Kindom","United Kongdom","The
Netherlands","switreland","switzerland","sweden","spain","romania","Portuga
l","new
zealand","norway","Netherlands","Netherland","Nederland","Monaco","Luxembou
rg","Luxemburg","LA","Luxemburg","Lithuania","iceland","ic","Ireland","hung
ary","greece","Germany","ireland.","france","finland","España","en","Englan
d, UK","England.","england UK","england (UK)","england -
UK","england","SP","Estonia","Denmark","czech
republic","cyprus","Belgium","Austria","Australia","andorra","ad","at","au"
,"be","ch","cy","cz","de","dk","ee","es","fi","fo","fr","fx","gb","gl","gr"
,"hr","hu","ie","is","it","li","lt","lu","lv","mc","nl","no","nz","pt","ro"
,"se","si","sk","uk","va","yu")))
ORDER BY profile.Country DESC;

Any help would be great, thanks!!
 
Before you get everyone copying and pasting and looking through your SQL, could you please tell us what if any error message you are getting? If you aren't getting an error message than tell us why you think it isn't working.

Duane
MS Access MVP
 
I am getting a "Invalid Procedure Call" message when I run the query..That's it. Not sure what that means?? Don't know how else to explain it.
 
This expression in the "Right" call will always return -2 and that is an invalid argument in the "Right" call

Len()-(Len([Email])-2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top