Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

DSum not working, please help!

Discussion in 'Information Technology' started by Gina Whipp, Jul 28, 2006.

Tags:
  1. Gina Whipp

    Gina Whipp
    Expand Collapse
    Guest

    I am trying to get the total hours taken if your time ahs been excused and
    all I get is Type Mismatch 13 error. It works if I remove 'And
    "[aExcused]=" - 1' but I need that to show me total excused hours. What am
    I doing wrong.

    Thanks in advance,
    Gina

    DaysOff = DSum("SumOfaTimeDecimal", "qryDaysOff", "aAssociateID = '" &
    AssociateID & "'" And "[aExcused]=" - 1)


    --
    Gina Whipp
     
  2. Loading...

    Similar Threads Forum Date
    Working with Christians #3 Blogs Oct 17, 2015
    Working with Christians #2 Blogs Oct 17, 2015
    Working With Muslims Blogs Oct 17, 2015
    Working with Christians Blogs Oct 17, 2015
    USA Working Mother, Washington Powerhouse? Good Luck. Breaking News Aug 2, 2014

  3. aaron.kempf@gmail.com

    aaron.kempf@gmail.com
    Expand Collapse
    Guest

    MDB isn't reliable enough for a single user and a single record.

    use SQL Server and a subquery instead of this trivial domain aggregate
    crap




    Gina Whipp wrote:
    > I am trying to get the total hours taken if your time ahs been excused and
    > all I get is Type Mismatch 13 error. It works if I remove 'And
    > "[aExcused]=" - 1' but I need that to show me total excused hours. What am
    > I doing wrong.
    >
    > Thanks in advance,
    > Gina
    >
    > DaysOff = DSum("SumOfaTimeDecimal", "qryDaysOff", "aAssociateID = '" &
    > AssociateID & "'" And "[aExcused]=" - 1)
    >
    >
    > --
    > Gina Whipp
     
  4. Gina Whipp

    Gina Whipp
    Expand Collapse
    Guest

    Not EXACTLY the answer I was looking for... NEXT


    <aaron.kempf@gmail.com> wrote in message
    news:1150217724.448681.281790@h76g2000cwa.googlegroups.com...
    > MDB isn't reliable enough for a single user and a single record.
    >
    > use SQL Server and a subquery instead of this trivial domain aggregate
    > crap
    >
    >
    >
    >
    > Gina Whipp wrote:
    >> I am trying to get the total hours taken if your time ahs been excused
    >> and
    >> all I get is Type Mismatch 13 error. It works if I remove 'And
    >> "[aExcused]=" - 1' but I need that to show me total excused hours. What
    >> am
    >> I doing wrong.
    >>
    >> Thanks in advance,
    >> Gina
    >>
    >> DaysOff = DSum("SumOfaTimeDecimal", "qryDaysOff", "aAssociateID = '" &
    >> AssociateID & "'" And "[aExcused]=" - 1)
    >>
    >>
    >> --
    >> Gina Whipp

    >
     
  5. Robert Morley

    Robert Morley
    Expand Collapse
    Guest

    It looks to me like you've got an extra quote in there, just before the
    "And"...it should be:

    DaysOff = DSum("SumOfaTimeDecimal", "qryDaysOff", "aAssociateID = '" &
    AssociateID & "' And "[aExcused]=" - 1)


    Also, is aAssociateID a string or a number? If it's a number, that would be
    another problem...remove the single quotes.


    Rob

    "Gina Whipp" <NotInterested@InViruses.com> wrote in message
    news:eSTGSkwjGHA.4748@TK2MSFTNGP04.phx.gbl...
    >I am trying to get the total hours taken if your time ahs been excused and
    >all I get is Type Mismatch 13 error. It works if I remove 'And
    >"[aExcused]=" - 1' but I need that to show me total excused hours. What am
    >I doing wrong.
    >
    > Thanks in advance,
    > Gina
    >
    > DaysOff = DSum("SumOfaTimeDecimal", "qryDaysOff", "aAssociateID = '" &
    > AssociateID & "'" And "[aExcused]=" - 1)
    >
    >
    > --
    > Gina Whipp
    >
     
  6. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    DaysOff = DSum("SumOfaTimeDecimal", "qryDaysOff", "aAssociateID = '" &
    AssociateID & "' And [aExcused]= - 1")


    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "Gina Whipp" <NotInterested@InViruses.com> wrote in message
    news:eSTGSkwjGHA.4748@TK2MSFTNGP04.phx.gbl...
    > I am trying to get the total hours taken if your time ahs been excused and
    > all I get is Type Mismatch 13 error. It works if I remove 'And
    > "[aExcused]=" - 1' but I need that to show me total excused hours. What

    am
    > I doing wrong.
    >
    > Thanks in advance,
    > Gina
    >
    > DaysOff = DSum("SumOfaTimeDecimal", "qryDaysOff", "aAssociateID = '" &
    > AssociateID & "'" And "[aExcused]=" - 1)
    >
    >
    > --
    > Gina Whipp
    >
    >
     
  7. Gina Whipp

    Gina Whipp
    Expand Collapse
    Guest

    aAssociateID is a string

    "Robert Morley" <rmorley@magma.ca.N0.Freak1n.sparn> wrote in message
    news:%23HXhT0wjGHA.1508@TK2MSFTNGP04.phx.gbl...
    > It looks to me like you've got an extra quote in there, just before the
    > "And"...it should be:
    >
    > DaysOff = DSum("SumOfaTimeDecimal", "qryDaysOff", "aAssociateID = '" &
    > AssociateID & "' And "[aExcused]=" - 1)
    >
    >
    > Also, is aAssociateID a string or a number? If it's a number, that would
    > be another problem...remove the single quotes.
    >
    >
    > Rob
    >
    > "Gina Whipp" <NotInterested@InViruses.com> wrote in message
    > news:eSTGSkwjGHA.4748@TK2MSFTNGP04.phx.gbl...
    >>I am trying to get the total hours taken if your time ahs been excused and
    >>all I get is Type Mismatch 13 error. It works if I remove 'And
    >>"[aExcused]=" - 1' but I need that to show me total excused hours. What
    >>am I doing wrong.
    >>
    >> Thanks in advance,
    >> Gina
    >>
    >> DaysOff = DSum("SumOfaTimeDecimal", "qryDaysOff", "aAssociateID = '" &
    >> AssociateID & "'" And "[aExcused]=" - 1)
    >>
    >>
    >> --
    >> Gina Whipp
    >>

    >
    >
     
  8. JimB

    JimB
    Expand Collapse
    Guest

    Try :
    DaysOff = DSum("SumOfaTimeDecimal", "qryDaysOff", "aAssociateID = '" &
    > AssociateID & "' And [aExcused] = " - 1)


    The And has to be inside the quotation marks. By putting the double quote
    after the single quote, you have taken it out. Note that AssociateID must be
    of type text, otherwise you wouldn't need the single quotes.

    Jim B

    "Gina Whipp" wrote:

    > I am trying to get the total hours taken if your time ahs been excused and
    > all I get is Type Mismatch 13 error. It works if I remove 'And
    > "[aExcused]=" - 1' but I need that to show me total excused hours. What am
    > I doing wrong.
    >
    > Thanks in advance,
    > Gina
    >
    > DaysOff = DSum("SumOfaTimeDecimal", "qryDaysOff", "aAssociateID = '" &
    > AssociateID & "'" And "[aExcused]=" - 1)
    >
    >
    > --
    > Gina Whipp
    >
    >
    >
     
  9. Gina Whipp

    Gina Whipp
    Expand Collapse
    Guest

    Thank you, thank you, thank you....


    "Douglas J Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
    news:eLvtO1wjGHA.3848@TK2MSFTNGP04.phx.gbl...
    > DaysOff = DSum("SumOfaTimeDecimal", "qryDaysOff", "aAssociateID = '" &
    > AssociateID & "' And [aExcused]= - 1")
    >
    >
    > --
    > Doug Steele, Microsoft Access MVP
    > http://I.Am/DougSteele
    > (no e-mails, please!)
    >
    >
    > "Gina Whipp" <NotInterested@InViruses.com> wrote in message
    > news:eSTGSkwjGHA.4748@TK2MSFTNGP04.phx.gbl...
    >> I am trying to get the total hours taken if your time ahs been excused
    >> and
    >> all I get is Type Mismatch 13 error. It works if I remove 'And
    >> "[aExcused]=" - 1' but I need that to show me total excused hours. What

    > am
    >> I doing wrong.
    >>
    >> Thanks in advance,
    >> Gina
    >>
    >> DaysOff = DSum("SumOfaTimeDecimal", "qryDaysOff", "aAssociateID = '" &
    >> AssociateID & "'" And "[aExcused]=" - 1)
    >>
    >>
    >> --
    >> Gina Whipp
    >>
    >>

    >
    >
     
  10. Gina Whipp

    Gina Whipp
    Expand Collapse
    Guest

    Thank you, thank you, thank you....

    "Robert Morley" <rmorley@magma.ca.N0.Freak1n.sparn> wrote in message
    news:%23HXhT0wjGHA.1508@TK2MSFTNGP04.phx.gbl...
    > It looks to me like you've got an extra quote in there, just before the
    > "And"...it should be:
    >
    > DaysOff = DSum("SumOfaTimeDecimal", "qryDaysOff", "aAssociateID = '" &
    > AssociateID & "' And "[aExcused]=" - 1)
    >
    >
    > Also, is aAssociateID a string or a number? If it's a number, that would
    > be another problem...remove the single quotes.
    >
    >
    > Rob
    >
    > "Gina Whipp" <NotInterested@InViruses.com> wrote in message
    > news:eSTGSkwjGHA.4748@TK2MSFTNGP04.phx.gbl...
    >>I am trying to get the total hours taken if your time ahs been excused and
    >>all I get is Type Mismatch 13 error. It works if I remove 'And
    >>"[aExcused]=" - 1' but I need that to show me total excused hours. What
    >>am I doing wrong.
    >>
    >> Thanks in advance,
    >> Gina
    >>
    >> DaysOff = DSum("SumOfaTimeDecimal", "qryDaysOff", "aAssociateID = '" &
    >> AssociateID & "'" And "[aExcused]=" - 1)
    >>
    >>
    >> --
    >> Gina Whipp
    >>

    >
    >
     
  11. John Vinson

    John Vinson
    Expand Collapse
    Guest

    On Tue, 13 Jun 2006 12:54:13 -0400, "Gina Whipp"
    <NotInterested@InViruses.com> wrote:

    >DaysOff = DSum("SumOfaTimeDecimal", "qryDaysOff", "aAssociateID = '" &
    >AssociateID & "'" And "[aExcused]=" - 1)


    The third argument of DSum needs to be constructed as a text string
    that looks like a SQL WHERE clause selecting the desired records. In
    this case you have the word AND *outside* the string you're building.
    In addition, since the -1 is a constant, it should be inside the
    quotes. It can be really confusing!

    If AssociateID is a Text datatype you need the quotemarks:

    DaysOff = DSum("SumOfaTimeDecimal", "qryDaysOff", "aAssociateID = '" &
    AssociateID & "' And [aExcused]= -1")

    If AssociateID is a Number (which would be more common, but I don't
    know how your table is set up) you don't need the singlequotes:

    DaysOff = DSum("SumOfaTimeDecimal", "qryDaysOff", "aAssociateID = " &
    AssociateID & " And [aExcused]= -1")


    John W. Vinson[MVP]
     
  12. Robert Morley

    Robert Morley
    Expand Collapse
    Guest

    No problem.


    Rob

    "Gina Whipp" <NotInterested@InViruses.com> wrote in message
    news:%239haZ4wjGHA.1260@TK2MSFTNGP05.phx.gbl...
    > Thank you, thank you, thank you....
     
  13. Gina Whipp

    Gina Whipp
    Expand Collapse
    Guest

    aAssociateID is set up as a text per clients request

    Thanks for the reply!

    "John Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
    news:nmut821cqls5f64gj57ucp1v11r67u7aqn@4ax.com...
    > On Tue, 13 Jun 2006 12:54:13 -0400, "Gina Whipp"
    > <NotInterested@InViruses.com> wrote:
    >
    >>DaysOff = DSum("SumOfaTimeDecimal", "qryDaysOff", "aAssociateID = '" &
    >>AssociateID & "'" And "[aExcused]=" - 1)

    >
    > The third argument of DSum needs to be constructed as a text string
    > that looks like a SQL WHERE clause selecting the desired records. In
    > this case you have the word AND *outside* the string you're building.
    > In addition, since the -1 is a constant, it should be inside the
    > quotes. It can be really confusing!
    >
    > If AssociateID is a Text datatype you need the quotemarks:
    >
    > DaysOff = DSum("SumOfaTimeDecimal", "qryDaysOff", "aAssociateID = '" &
    > AssociateID & "' And [aExcused]= -1")
    >
    > If AssociateID is a Number (which would be more common, but I don't
    > know how your table is set up) you don't need the singlequotes:
    >
    > DaysOff = DSum("SumOfaTimeDecimal", "qryDaysOff", "aAssociateID = " &
    > AssociateID & " And [aExcused]= -1")
    >
    >
    > John W. Vinson[MVP]
    >
     

Share This Page