Subject | Re: [ib-support] Select statement |
---|---|
Author | Walter Neumann |
Post date | 2003-02-10T11:47:15Z |
Am Sonntag, 9. Februar 2003 23:35 schrieb Aage Johansen:
statement is ok. There is for the DataSet a property RecordCount. If I read
this property comes the error message. So I thought it is a problem of the
dbExpress driver and tried it with a SP:
ANZAHL = (SELECT COUNT (*) FROM MITARBVIEW MA
WHERE 'TODAY' >= (SELECT MAX(EA.EINTRITTSDATUM) FROM MITARBEINAUSVIEW EA
WHERE ((EA.MITARBID = MA.PERSONENIDINT) AND ((EA.AUSTRITTSDATUM IS
NULL) OR (EA.AUSTRITTSDATUM >= 'TODAY')))));
SUSPEND;
Now I recieve error -206 "subselect is illegal in this context". How can I
count, if subselect is illegal? The task is:
Table 1 contains the employees and table 2 the starting and ending dates for
all employees. But for 1 employee can exist many starting and ending dates.
How can I know, how many employees are working now?
Thank you for your suggestions. Walter.
> Show us the statement where you do the count.I use Kylix 2 and dbExpress. Opening the SQLDataSet with the postet select
statement is ok. There is for the DataSet a property RecordCount. If I read
this property comes the error message. So I thought it is a problem of the
dbExpress driver and tried it with a SP:
ANZAHL = (SELECT COUNT (*) FROM MITARBVIEW MA
WHERE 'TODAY' >= (SELECT MAX(EA.EINTRITTSDATUM) FROM MITARBEINAUSVIEW EA
WHERE ((EA.MITARBID = MA.PERSONENIDINT) AND ((EA.AUSTRITTSDATUM IS
NULL) OR (EA.AUSTRITTSDATUM >= 'TODAY')))));
SUSPEND;
Now I recieve error -206 "subselect is illegal in this context". How can I
count, if subselect is illegal? The task is:
Table 1 contains the employees and table 2 the starting and ending dates for
all employees. But for 1 employee can exist many starting and ending dates.
How can I know, how many employees are working now?
Thank you for your suggestions. Walter.