By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,900 Members | 1,364 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,900 IT Pros & Developers. It's quick & easy.

"Data type mismatch in criteria expression"

P: n/a
I am using MS Access 2003 and get the following error "Data type
mismatch in criteria expression"

Any suggestions on how to fix this?

This is my code:

SELECT IIf([A_Sub]=15 Or [a_sub]=19, "15 og 19",
IIf([A_Sub]=13 Or [a_sub]=17,"13 og 17",
IIf([A_Sub]=16 Or [a_sub]=20,"16 og 20",
IIf([A_Sub]=14 Or [a_sub]=18,"14 og 18",
IIf([A_Sub]=9, "9",
IIf([A_Sub]=10,"10",
IIf([A_Sub]=11,"11",IIf([A_Sub]=12,"12")))
))))) AS A_SubGruppe, Count(MDSDBA_COMP_ALG.A_Sub) AS Ana_subOfA_Sub
FROM MDSDBA_COMP_ALG
GROUP BY IIf([A_Sub]=15 Or [a_sub]=19,"15 og 19",
IIf([A_Sub]=13 Or [a_sub]=17,"13 og 17",
IIf([A_Sub]=16 Or [a_sub]=20,"16 og 20",
IIf([A_Sub]=14 Or [a_sub]=18,"14 og 18",
IIf([A_Sub]=9,"9",
IIf([A_Sub]=10,"10",
IIf([A_Sub]=11,"11",
IIf([A_Sub]=12,"12"))))))));

Thank you!,
John

Jan 19 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
John:

Please see the response I posted for you at
http://groups.google.com/group/comp....2142f626bf9615
which will make this query MUCH simpler.

Jana
jmarr02s wrote:
I am using MS Access 2003 and get the following error "Data type
mismatch in criteria expression"

Any suggestions on how to fix this?

This is my code:

SELECT IIf([A_Sub]=15 Or [a_sub]=19, "15 og 19",
IIf([A_Sub]=13 Or [a_sub]=17,"13 og 17",
IIf([A_Sub]=16 Or [a_sub]=20,"16 og 20",
IIf([A_Sub]=14 Or [a_sub]=18,"14 og 18",
IIf([A_Sub]=9, "9",
IIf([A_Sub]=10,"10",
IIf([A_Sub]=11,"11",IIf([A_Sub]=12,"12")))
))))) AS A_SubGruppe, Count(MDSDBA_COMP_ALG.A_Sub) AS Ana_subOfA_Sub
FROM MDSDBA_COMP_ALG
GROUP BY IIf([A_Sub]=15 Or [a_sub]=19,"15 og 19",
IIf([A_Sub]=13 Or [a_sub]=17,"13 og 17",
IIf([A_Sub]=16 Or [a_sub]=20,"16 og 20",
IIf([A_Sub]=14 Or [a_sub]=18,"14 og 18",
IIf([A_Sub]=9,"9",
IIf([A_Sub]=10,"10",
IIf([A_Sub]=11,"11",
IIf([A_Sub]=12,"12"))))))));

Thank you!,
John
Jan 19 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.