Results 1 to 5 of 5
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Twin Queries Behave Differently (2003)

    In the startup form of the attached mdb, please select gennaio(january) as starting month, febbraio(february) as final month and the year 2007,
    Why does Query5_2Ppi open without problems while Query5_3Ppi gives an error, being that they're virtually identical?
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Twin Queries Behave Differently (2003)

    The Nz function returns a string, so the + acts as concatenation operator instead of addition. But you don't need the expression, you can use Totale instead - this *is* the sum of [1], [2] etc.:

    SELECT *
    FROM QueryFermi3Ppi
    WHERE Totale<>0

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Twin Queries Behave Differently (2003)

    Thank you Hans <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Why do the text boxes in the detail section of the RFermi2Ppi report display decimals in spite of being formatted with zero decimals?
    Attached Files Attached Files

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Twin Queries Behave Differently (2003)

    Same cause: Nz returns a string value, so the report sees the fields [1] etc. as text. You can work around this by editing QueryFermi2Ppi and changing the definition of Totale:

    Totale: Val(Nz(Sum([G1].[OREF]),0))

    and of ConteggioDIF:

    ConteggioDIF: Val(Nz(Sum(G1.OREF),0))

    The Val function converts the string value to a number.

  5. #5
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Twin Queries Behave Differently (2003)

    Thank you Hans

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •