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

    Query Doesn't Return Selected Month (2003)

    On the startup form of the attached mdb, please select May 2006 as beginning month and year and June 2006 as ending month and year and run the QryYield query. How come the values for June 2006 aren't displayed?

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

    Re: Query Doesn't Return Selected Month (2003)

    Because G3Maz doesn't contain records for June.

    Here are simplified versions of your utility functions:

    Function GMese(Anno As Integer, Mese As Integer) As Integer
    GMese = Day(DateSerial(Anno, Mese + 1, 0))
    End Function

    Function OreMese(Anno As Integer, Mese As Integer, Optional Bool As Boolean) As Integer
    Dim m As Integer
    If Bool = False Then
    OreMese = 24 * GMese(Anno, Mese)
    Else
    For m = 1 To Mese
    OreMese = OreMese + 24 * GMese(Anno, m)
    Next m
    End If
    End Function

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

    Re: Query Doesn't Return Selected Month (2003)

    Thank you Hans for the two compact functions <img src=/S/smile.gif border=0 alt=smile width=15 height=15>.
    I've tried to use the nz function in QryYield to make up for the fact G3Maz doesn't have data in June but still the query doesn't return it. Isn't there a way to have June displayed?

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

    Re: Query Doesn't Return Selected Month (2003)

    Change the joins in the query to outer joins that include all records from PortDez23.

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

    Re: Query Doesn't Return Selected Month (2003)

    Thank you Hans <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

Posting Permissions

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