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

Can't figure out error in simple dsum

P: n/a
I have the following table test3.

RESERVATIONID Site SitePrice
101 RV2 $25.00
101 RV3 $25.00
102 RV4 $25.00
102 RV5 $25.00
104 RV10 $25.00

I created a query with the following dsum

DSum("SitePrice", "test3", "Reservationid = 101")

When I try to view query I get the following error. Anyone know whats
going on?

"Data type mismatch in criteria expression"

Dec 19 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
deercreek wrote in message
<11*********************@z14g2000cwz.googlegroups. com> :
I have the following table test3.

RESERVATIONID Site SitePrice
101 RV2 $25.00
101 RV3 $25.00
102 RV4 $25.00
102 RV5 $25.00
104 RV10 $25.00

I created a query with the following dsum

DSum("SitePrice", "test3", "Reservationid = 101")

When I try to view query I get the following error. Anyone know whats
going on?

"Data type mismatch in criteria expression"


What datatype is Reservationid? I'm guessing it's text, then add single
quotes.

...., "Reservationid = '101'")

I don't use the Domain Aggregates much, but aren't some of the
arguements supposed to be [bracketed]?

You could probably also do a pure query like

select sum(siteprice) as mysum
from yourtable
where Reservationid = '101'

--
Roy-Vidar

Dec 19 '05 #2

P: n/a
On 19 Dec 2005 09:03:39 -0800, deercreek wrote:
I have the following table test3.

RESERVATIONID Site SitePrice
101 RV2 $25.00
101 RV3 $25.00
102 RV4 $25.00
102 RV5 $25.00
104 RV10 $25.00

I created a query with the following dsum

DSum("SitePrice", "test3", "Reservationid = 101")

When I try to view query I get the following error. Anyone know whats
going on?

"Data type mismatch in criteria expression"


Your expression looks OK if the datatype of the [ReservationID] field
is number. Since you are getting a datatype mismatch error, I would
have to assume the datatype is actually Text.
Try:

Total: DSum("[SitePrice]", "test3", "[Reservationid] = '101'")

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Dec 19 '05 #3

P: n/a
deercreek wrote:
DSum("SitePrice", "test3", "Reservationid = 101")

When I try to view query I get the following error. Anyone know whats
going on?

"Data type mismatch in criteria expression"


What fields type is ReservationID? Check it in the design view of test3.

If it is numeric, the above should work. If it is a text data type,
then alter your expression as follows:

DSum("SitePrice", "test3", "Reservationid = ""101""")

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Dec 19 '05 #4

P: n/a
Please don't multipost. I just saw this one answered in another ng. (ms.p.a.forms)
Also other days I saw multiposts from you.
Crosspost if you really *need* to post to mere ng's. That way one can see when a problem is solved.
Thanks,

Arno R

"deercreek" <da*@deercreekcg.com> schreef in bericht news:11*********************@z14g2000cwz.googlegro ups.com...
I have the following table test3.

RESERVATIONID Site SitePrice
101 RV2 $25.00
101 RV3 $25.00
102 RV4 $25.00
102 RV5 $25.00
104 RV10 $25.00

I created a query with the following dsum

DSum("SitePrice", "test3", "Reservationid = 101")

When I try to view query I get the following error. Anyone know whats
going on?

"Data type mismatch in criteria expression"

Dec 19 '05 #5

P: n/a
Sorry did't know proper etiquette!

Dec 19 '05 #6

P: n/a
On Mon, 19 Dec 2005 19:13:42 +0100, StopThisAdvertising wrote:
Please don't multipost. I just saw this one answered in another ng. (ms.p.a.forms)
Also other days I saw multiposts from you.
Crosspost if you really *need* to post to mere ng's. That way one can see when a problem is solved.
Thanks,

Arno R

"deercreek" <da*@deercreekcg.com> schreef in bericht news:11*********************@z14g2000cwz.googlegro ups.com...
I have the following table test3.

RESERVATIONID Site SitePrice
101 RV2 $25.00
101 RV3 $25.00
102 RV4 $25.00
102 RV5 $25.00
104 RV10 $25.00

I created a query with the following dsum

DSum("SitePrice", "test3", "Reservationid = 101")

When I try to view query I get the following error. Anyone know whats
going on?

"Data type mismatch in criteria expression"


Arno,
You might want to change your From: line persona when replying to
'normal' posters, and save the heavy stuff for PC. :-)

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Dec 19 '05 #7

P: n/a
Sorry too!
Used wrong account to answer you ;-)

Arno R

"deercreek" <da*@deercreekcg.com> schreef in bericht news:11**********************@g49g2000cwa.googlegr oups.com...
Sorry did't know proper etiquette!

Dec 19 '05 #8

P: n/a

"fredg" <fg******@example.invalid> schreef in bericht news:1t*****************************@40tude.net...
Arno,
You might want to change your From: line persona when replying to
'normal' posters, and save the heavy stuff for PC. :-)


Yes, sorry for that.
I sure can understand why PC sometimes made this kind of mistake with his multiple persona's ...

Arno R

Dec 19 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.