Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Crosstab SQL (A2k SR1)

    With the following crosstab SQL, how would I enforce it to handle null entries in the calculation.

    I would like to revert them to 0(zero)

    TRANSFORM Avg(qryPaint.TOTAL) AS AvgOfTOTAL
    SELECT qryPaint.INSURER
    FROM qryPaint
    GROUP BY qryPaint.INSURER
    PIVOT Format([DATE OF ENTRY],"mmm") In ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug"," Sep","Oct","Nov","Dec");

    Also.
    If the calculation is derived from lets say 10 jobs.

    1=

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

    Re: Crosstab SQL (A2k SR1)

    I'm confused. You state that you want the query
    <hr>to handle null entries in the calculation<hr>
    but also to ignore these values:<blockquote><hr>the avg should be

  3. #3
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Crosstab SQL (A2k SR1)

    Thanks Hans.
    I'm getting quite good at confusing people now.
    I'll give your method a go.
    <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

Posting Permissions

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