Access Query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #31
    Originally posted by imtmub
    I change in the qryDistribution (Union query). u can c the codes. Now i reduce 6 tables to 2 tables. I hope i did correct. u can have a look on the code in previous post.
    I can't really follow what you're doing any more but you had too many [VenueId] in the WHERE clause.

    Code for Monthly Distribution:
    SELECT MonthName, [VenueId], [VenueName_EN], Sum(AmtDS) AS TotalDS, Sum(AmtGW) AS TotalGW, Sum(AmtML) AS TotalML, Sum(AmtDist) AS TotalDist
    FROM qryDistribution
    WHERE [VenueId]=[Forms]![Search]![Combo0]
    GROUP BY MonthName, [VenueId], [VenueName_EN];

    Comment

    • imtmub
      New Member
      • Nov 2006
      • 112

      #32
      Originally posted by mmccarthy
      I can't really follow what you're doing any more but you had too many [VenueId] in the WHERE clause.

      Code for Monthly Distribution:
      SELECT MonthName, [VenueId], [VenueName_EN], Sum(AmtDS) AS TotalDS, Sum(AmtGW) AS TotalGW, Sum(AmtML) AS TotalML, Sum(AmtDist) AS TotalDist
      FROM qryDistribution
      WHERE [VenueId]=[Forms]![Search]![Combo0]
      GROUP BY MonthName, [VenueId], [VenueName_EN];
      Bcz u had given the suggestion to change the code to get the result by venue.

      Comment

      Working...