DSum Problem

D

DS

This DSum works until I add the Sent criteria, anyhelp appreciated.
Thanks
DS

Me.Text5 = Nz(DSum("[BasePrice]*[QtyPrice]", "SalesDetailsMoney",
"[SalesID] = " & Forms!CheckPreview!TxtSalesID & " And [Sent] = -1"), 0)
End Sub
 
D

Duane Hookom

Is [Sent] a yesno field? Is it included in your query? It would help to know
more than just "works until". You didn't say anything about why you think it
didn't work.
 
D

DS

Duane said:
Is [Sent] a yesno field? Is it included in your query? It would help to know
more than just "works until". You didn't say anything about why you think it
didn't work.
Sent is a yes/no field. And it returns notning after I add the field.
Thanks
DS
 
D

Duane Hookom

"returns nothing"? Do you mean it doesn't even return a 0?
I would open the query and enter SQL like the following to see if you can
tell your issue:

SELECT SUM([BasePrice]*[QtyPrice]) as PriceQty
FROM SalesDetailsMoney
WHERE [SalesID] = Forms!CheckPreview!TxtSalesID And [Sent] = -1;

--
Duane Hookom
MS Access MVP


DS said:
Duane said:
Is [Sent] a yesno field? Is it included in your query? It would help to
know more than just "works until". You didn't say anything about why you
think it didn't work.
Sent is a yes/no field. And it returns notning after I add the field.
Thanks
DS
 
D

DS

Duane said:
"returns nothing"? Do you mean it doesn't even return a 0?
I would open the query and enter SQL like the following to see if you can
tell your issue:

SELECT SUM([BasePrice]*[QtyPrice]) as PriceQty
FROM SalesDetailsMoney
WHERE [SalesID] = Forms!CheckPreview!TxtSalesID And [Sent] = -1;
Thanks Duane, I found the problem, the Sent field was deleted from the
table!
My aplolgies. and thanks for the response.
DS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Not Aligning 2
SQL Woes 4
Setting Textbox with SQL 2
Two D Statemnets 4
DSUM Not Working 5
DSum Problem 2
DSum Problem 2
A Better Way 4

Top