SUM Function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • DS

    SUM Function

    I need to attach an Expression to a unbound text box that says.....

    IIf([Quantity Sold]=0,0,=Sum([Quantity Sold])) is the syntex wrong!

    But it's not working...basic ally I have an Unbound Textbox That Sums up
    the total of Quantity Sold. But If I don't have a record, the field
    comes up blank all though I still have a number that should go in there,
    like the starting Inventory. Once I put a record in, it works fine.

    Thanks
    DS
  • Ken Snell

    #2
    Re: SUM Function

    Try this:

    =Sum(Nz([Quantity Sold], 0))


    --

    Ken Snell
    <MS ACCESS MVP>

    "DS" <bootybox@opton line.net> wrote in message
    news:zHm7d.2237 1$kq6.12299140@ news4.srv.hcvln y.cv.net...[color=blue]
    > I need to attach an Expression to a unbound text box that says.....
    >
    > IIf([Quantity Sold]=0,0,=Sum([Quantity Sold])) is the syntex wrong!
    >
    > But it's not working...basic ally I have an Unbound Textbox That Sums up
    > the total of Quantity Sold. But If I don't have a record, the field
    > comes up blank all though I still have a number that should go in there,
    > like the starting Inventory. Once I put a record in, it works fine.
    >
    > Thanks
    > DS[/color]


    Comment

    • DS

      #3
      Re: SUM Function

      Ken Snell wrote:
      [color=blue]
      > Try this:
      >
      > =Sum(Nz([Quantity Sold], 0))
      >
      >[/color]
      Thanks,
      What does the NZ stand for?
      DS

      Comment

      • Ken Snell

        #4
        Re: SUM Function

        The Nz function converts a Null to the value that you specify. So, if the
        value of [Quantity Sold] field in any record is Null, a zero is substituted
        for the Null. If there are no records at all, the Null value is replaced by
        zero.

        --

        Ken Snell
        <MS ACCESS MVP>

        "DS" <bootybox@opton line.net> wrote in message
        news:sen7d.2239 5$kq6.12406486@ news4.srv.hcvln y.cv.net...[color=blue]
        > Ken Snell wrote:
        >[color=green]
        > > Try this:
        > >
        > > =Sum(Nz([Quantity Sold], 0))
        > >
        > >[/color]
        > Thanks,
        > What does the NZ stand for?
        > DS[/color]


        Comment

        Working...