G
gavin
I have a database of name and addresses and I want to count how many
instances of each incode (the bit before the space) there are.
I already have this working in a separate database using this SQL:
SELECT Left$([post_code],InStr([post_code]," ")-1) AS Incode, Count(*) AS
Total
FROM tblcustomer
GROUP BY Left$([post_code],InStr([post_code]," ")-1)
In my new database I have done exactly the same but this time when I run the
query I am getting this error:
"Data type mismatch in criteria expression"
Can anybody help me figure out what is wrong. As far as I can see the two
databases are the same (but obviously they're not!!!).
Also would it matter if there were blank records in the post code field? If
so, is there a way of getting round that?
Thanks for any help,
Gavin
instances of each incode (the bit before the space) there are.
I already have this working in a separate database using this SQL:
SELECT Left$([post_code],InStr([post_code]," ")-1) AS Incode, Count(*) AS
Total
FROM tblcustomer
GROUP BY Left$([post_code],InStr([post_code]," ")-1)
In my new database I have done exactly the same but this time when I run the
query I am getting this error:
"Data type mismatch in criteria expression"
Can anybody help me figure out what is wrong. As far as I can see the two
databases are the same (but obviously they're not!!!).
Also would it matter if there were blank records in the post code field? If
so, is there a way of getting round that?
Thanks for any help,
Gavin