Results 1 to 2 of 2
  1. #1
    RAJESHKUMAR R is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2017
    Posts
    48

    Crosstab Query “Min” Function Not Considering Zero

    Dear Friends,

    Code:
    SELECT MASTER.finished_part_no, MASTER.terminal_from, MASTER.crimp_type_from, MASTER.crimp_type_to, MASTER.terminal_to, MASTER.cable_part, MASTER.cable_type, MASTER.awg, MASTER.wire_color, MASTER.length, MASTER.qty_pc,
    Code:
    Nz([Database_Crosstab].[Total Of Net Inventory],0) AS [Kitting Inventory], Nz([Total Of Net Inventory]/[qty_pc],0) AS [Min FG Can Feed]
    FROM MASTER LEFT JOIN Database_Crosstab ON MASTER.cable_type = Database_Crosstab.cable_type
    ORDER BY MASTER.length;


    In the Above Query, Red Highlighted portion, I have used Nz Function to Replace black cell as Zero
    When I am trying to create the Crosstab Query as below With above query table, Even though I am taking “Min” in crosstab query… Let’s say one of “finished_part_no” contains 5 Records in above Query table out of which one Row contains “zero value”, Ideally my crosstab result for that “finished_part_no” should be “Zero” Whereas crosstab query ignoring Zero value and updating next least value in the Result…

    Code:
    TRANSFORM Min(([Min FG Can Feed])) AS Expr1
    Code:
    SELECT FG_Completeness.finished_part_no, Min(([Min FG Can Feed])) AS [Total Of Min FG Can Feed]
    FROM FG_Completeness
    GROUP BY FG_Completeness.finished_part_no
    PIVOT FG_Completeness.awg


    Could you please help me in amending these query to come out of my concern i.e. MIN Should consider Zero too update the crosstab query Result?

    Thanks & Regards,


    Rajeshkumar R

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    First query references a dataset named Database_Crosstab - this is a crosstab query?
    Then second query is a crosstab of the first query (which includes a crosstab)?
    Never seen that.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Crosstab trouble with count function
    By fret hack in forum Queries
    Replies: 1
    Last Post: 03-07-2019, 11:48 AM
  2. Crosstab with sum and count function?
    By alibanks in forum Queries
    Replies: 1
    Last Post: 01-31-2015, 09:25 PM
  3. Replies: 10
    Last Post: 01-07-2014, 04:03 PM
  4. Advanced Crosstab query with SUM-function
    By ino_mart in forum Queries
    Replies: 3
    Last Post: 01-12-2012, 02:53 PM
  5. Replies: 1
    Last Post: 07-30-2010, 10:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums