calculate Sum of group of records

G

Guest

I try to get a total of the amount received till a certain month which I
enter on my Form as number. I make a querry as follows, but it returns wrong
values. What am I doing wrong here?

SELECT Sum(T_RECEIVED.[Amount in VND]) AS [SumOfAmount in VND]
FROM T_RECEIVED
HAVING (((Month([Date]))<(Forms!SPENT!MNO)));

Seems like the confusion comes from being not able to distinguish months
No.1, 10, 11, 12. How could this be fixed?

Thank you.
Lana
 
N

Nikos Yannacopoulos

Lana,

With a 99% certainty, your problem is due to the fact that you are using a
date field named "Date"; Date is a reserved Access keyword, specifically a
built-in function which returns the current system date. Change the name od
the field to something different, e.g. PmtDate or something, in your table
design and everywhere else it appears.

HTH,
Nikos
 
D

Duane Hookom

Try:
SELECT Sum(T_RECEIVED.[Amount in VND]) AS [SumOfAmount in VND]
FROM T_RECEIVED
WHERE Month([Date])<Val(Forms!SPENT!MNO);
 
G

Guest

Thank you Nikos, thank you Duane!

When I emplemented both your advices it worked!!

Lana
 

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


Top