467,910 Members | 1,588 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,910 developers. It's quick & easy.

"Data type mismatch in criteria expression"

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
  • viewed: 3272
Share:
1 Reply
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.

Similar topics

By using this site, you agree to our Privacy Policy and Terms of Use.