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!

SQL Where clause

Status
Not open for further replies.

Zaz666

Technical User
Apr 30, 2004
1
GB
Hi,

We have agents with the same skills spread over two sites. The agents have different logid ranges 1000-2000 and 3000-4000.

All I want to do is limit the agents returned by a query to either
...and LOGID >3000...
or
...and LOGID <2000...

ACD=$acd AND OLDEST_LOGON > 0 AND LOGID >3000

This apparently creates an "ISAM error:illegal argument to ISAM function" when I attempt to run the report.

I have tried any combination of LOGID IN (...) and any other "proper" sql terms that should work. Everyone creates the same error.

Any ideas?
or workarounds?
 
in agent tables, logid has an ascii datatype. so no arithmetic analysis until you cast it as an integer.

not sure of the informix syntax to do that, but that is the direction you should look.

 
Hi Zaz666

If you look at the where clause for the Agent Group Report you'll see it has an embedded select statement of

and LOGID in ( select value from agroups where ACD=$acd and item_name =[Agent Group:])

If you have two sites I would leave out ACD=$acd
as this will only select rows for your current acd.

The above clause also uses
item_name =[Agent Group:]
an input called Agent Group required to run report.

I would change this to the following

and LOGID in ( select value from agroups where item_name ="All" )

Then in CentreVu Dictionary create Agent Group called All and put the required Logids into this Group.

Hope this helps.
Paul
 
I am also having a similar problem i.e. I'm getting the same error message.

I am wanting to select agents from multiple skills but only want to show one record for each agent. I am selecting data from the CAGENT table and want to create the following statement:
select LOGID, WORKMODE, min(AGTIME)
from cagent
where ACD=1 and (SPLIT=2 or SPLIT=3 or SPLIT=9 or SPLIT=29)
group by LOGID, WORKMODE


but this returns the "ISAM error:illegal argument to ISAM function" error.

If I just run it for the agents it works OK:
select LOGID, min(AGTIME)
from cagent
where ACD=1 and (SPLIT=2 or SPLIT=3 or SPLIT=9 or SPLIT=29)
group by LOGID


Can anyone explain why and suggest a fix?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top