how to code sum if (...) in access same like sumif(......) in exce

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i want to sum if data in table in access database. means same item must be
calculate sum.
sum if like sum if in excel. how to write code?
any body can help me?
 
hisham said:
i want to sum if data in table in access database. means same item must be
calculate sum.
sum if like sum if in excel. how to write code?


Try this kind of expression:
Sum(IIf(condition, item, 0))
 
Marshall Barton said:
Try this kind of expression:
Sum(IIf(condition, item, 0))

Dear member,

I want to create coding for sum if in access.
Any can translate to me how to code sum if.
Table1 have tickectNo, item_partno and qty
Table2 have item_partno, qty1, qty2, and result.

When I click one button generate;
* sum (qty in table1) insert to qty2 in table2
* qty2 - qty 1 insert to result

pls help me to code in VBA
 
hisham said:
I want to create coding for sum if in access.
Any can translate to me how to code sum if.
Table1 have tickectNo, item_partno and qty
Table2 have item_partno, qty1, qty2, and result.

When I click one button generate;
* sum (qty in table1) insert to qty2 in table2
* qty2 - qty 1 insert to result


VBA would be a slow and complicated way to do that kind of
calculation. Instead, you should use a query to sum a
column of values in a database table. Even then the result
should not be saved back to any table.

I guess what I am trying to say is that the way you would
create a spreadsheet does not work when you are creating a
database. You need to do some homework or take a class in
database design and using queries before you start trying to
do the kinds of things you are asking about.
 
Back
Top