In a data environment I write code like:
select ([exam fee]*[other fee]) as total from table1
then it work, but when I write like below it not work:
select sum[exam fee] as total from table1
what problem with it?

How does it not work?

and should that not be ([exam fee] + [other fee])

Good Luck

another thing. I write like:
"select sum[exam fee] as total , sum[other fee] as total_fee from table1"
it not work

Are the fields numeric? If not that could be your problem but without seeing your code who knows.


Good Luck

ya that field are numeric.

NOTE:

sum[exam fee]  ==>   sum([exam fee])

NOTE:

sum[exam fee]  ==>   sum([exam fee])

I don't understand by this code. I want sum[exam fee] and sum[other fee]. is it possible with your code?

I don't understand by this code. I want sum[exam fee] and sum[other fee]. is it possible with your code?

yes.
SUM is a sql function. you must use '(' & ')' for it.

change your code in this way:

"select sum[B]([/B][exam fee][B])[/B] as total , sum[B]([/B][other fee][B])[/B] as total_fee from table1"

thanks Mtb 925. it works well. another thing when I input exam fee in a form and when I see the report it not update. I mean exam fee is 200 and I add again 200. so report will show 400/ but it show 200, when I exit and again open the project then show 400. please help me

thanks Mtb 925. it works well. another thing when I input exam fee in a form and when I see the report it not update. I mean exam fee is 200 and I add again 200. so report will show 400/ but it show 200, when I exit and again open the project then show 400. please help me

Your welcome.

you must reconnect it. attach your sample. i will edit it.

you must reconnect it
reconnect mean......................

you must reconnect it
reconnect mean......................

reconnect mean attach your code. :icon_wink:

try refreshing your connection.....ADO ....RDO whatever u r using

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.