doktorn
10-12-2002, 11:15 AM
Hello!
I have a general question about a sql-statement. I wonder if the following statement is a correct statement?
SELECT personal.skiftlag, COUNT(merit.kurskod) AS res
FROM personal INNER JOIN merit ON personal.anstnr = merit.anstnr
WHERE merit.kurskod = 'B2-DM' AND skiftlag = 1;
The problem seems to be that I can´t use COUNT together with anything else, if I do this everything works allright:
SELECT COUNT(merit.kurskod) AS res
FROM merit
WHERE merit.kurskod = 'B2-DM';
I am using an access 2000 database if that has anything to do with my problem. I have heard that access has certain limitations regarding sql.
Thanks in advance :)
I have a general question about a sql-statement. I wonder if the following statement is a correct statement?
SELECT personal.skiftlag, COUNT(merit.kurskod) AS res
FROM personal INNER JOIN merit ON personal.anstnr = merit.anstnr
WHERE merit.kurskod = 'B2-DM' AND skiftlag = 1;
The problem seems to be that I can´t use COUNT together with anything else, if I do this everything works allright:
SELECT COUNT(merit.kurskod) AS res
FROM merit
WHERE merit.kurskod = 'B2-DM';
I am using an access 2000 database if that has anything to do with my problem. I have heard that access has certain limitations regarding sql.
Thanks in advance :)