A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

"Data type mismatch in expression"



 
 
Thread Tools Display Modes
  #1  
Old July 2nd, 2007, 10:14 AM posted to microsoft.public.access.queries
mohsin via AccessMonster.com
external usenet poster
 
Posts: 44
Default "Data type mismatch in expression"

Hi expert

I got this ""Data type mismatch in expression" error message while running my
queries.

SELECT qrymaxallca1.NE, qrymaxallca1.Date, Sum([qrymaxallca1]!
[TCAT_CALL_AMOUNT]) AS BHCA
FROM qrymaxallca1
WHERE (((([qrymaxallca1]![TCATID]))=34 Or (([qrymaxallca1]![TCATID]))=32 Or (
([qrymaxallca1]![TCATID]))=45 Or (([qrymaxallca1]![TCATID]))=16 Or ((
[qrymaxallca1]![TCATID]))=15 Or (([qrymaxallca1]![TCATID]))=13))
GROUP BY qrymaxallca1.NE, qrymaxallca1.Date;

Basically what i try to do is, to sum the value in call amount field base on
ID 34,32,45,16,15,13

Can you help me to recognised the error please.

- thank you

--
Cheers
Mohsin

Message posted via http://www.accessmonster.com

  #2  
Old July 2nd, 2007, 10:38 AM posted to microsoft.public.access.queries
Ofer Cohen
external usenet poster
 
Posts: 1,683
Default "Data type mismatch in expression"

What is the TCATID field type?
If its a text field you need to add double quote before and after the value.

Also, you can make this SQL shrter using In

SELECT qrymaxallca1.NE, qrymaxallca1.Date, Sum([qrymaxallca1]!
[TCAT_CALL_AMOUNT]) AS BHCA
FROM qrymaxallca1
WHERE [qrymaxallca1]![TCATID] In (34,32,45,16,15,13)
GROUP BY qrymaxallca1.NE, qrymaxallca1.Date

And if it a text field
SELECT qrymaxallca1.NE, qrymaxallca1.Date, Sum([qrymaxallca1]!
[TCAT_CALL_AMOUNT]) AS BHCA
FROM qrymaxallca1
WHERE [qrymaxallca1]![TCATID] In ("34","32","45","16","15","13")
GROUP BY qrymaxallca1.NE, qrymaxallca1.Date

--
Good Luck
BS"D


"mohsin via AccessMonster.com" wrote:

Hi expert

I got this ""Data type mismatch in expression" error message while running my
queries.

SELECT qrymaxallca1.NE, qrymaxallca1.Date, Sum([qrymaxallca1]!
[TCAT_CALL_AMOUNT]) AS BHCA
FROM qrymaxallca1
WHERE (((([qrymaxallca1]![TCATID]))=34 Or (([qrymaxallca1]![TCATID]))=32 Or (
([qrymaxallca1]![TCATID]))=45 Or (([qrymaxallca1]![TCATID]))=16 Or ((
[qrymaxallca1]![TCATID]))=15 Or (([qrymaxallca1]![TCATID]))=13))
GROUP BY qrymaxallca1.NE, qrymaxallca1.Date;

Basically what i try to do is, to sum the value in call amount field base on
ID 34,32,45,16,15,13

Can you help me to recognised the error please.

- thank you

--
Cheers
Mohsin

Message posted via http://www.accessmonster.com


  #3  
Old July 2nd, 2007, 12:59 PM posted to microsoft.public.access.queries
mohsin via AccessMonster.com
external usenet poster
 
Posts: 44
Default "Data type mismatch in expression"

Thanks cohen

After recheck in the table properties, the TCATID is text, what is need is
"number" type.

-thank you

Ofer Cohen wrote:
What is the TCATID field type?
If its a text field you need to add double quote before and after the value.

Also, you can make this SQL shrter using In

SELECT qrymaxallca1.NE, qrymaxallca1.Date, Sum([qrymaxallca1]!
[TCAT_CALL_AMOUNT]) AS BHCA
FROM qrymaxallca1
WHERE [qrymaxallca1]![TCATID] In (34,32,45,16,15,13)
GROUP BY qrymaxallca1.NE, qrymaxallca1.Date

And if it a text field
SELECT qrymaxallca1.NE, qrymaxallca1.Date, Sum([qrymaxallca1]!
[TCAT_CALL_AMOUNT]) AS BHCA
FROM qrymaxallca1
WHERE [qrymaxallca1]![TCATID] In ("34","32","45","16","15","13")
GROUP BY qrymaxallca1.NE, qrymaxallca1.Date

Hi expert

[quoted text clipped - 15 lines]

- thank you


--
Cheers
Mohsin

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200707/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:18 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.