2 couloms from 2 dates

  • I have rows of 2 dates and data

    i would like to sum one date into one Coulomb the other to another coulomb.

    what i did is 2 sql's those 2 sql's i would like to combine to one with 2 coulombs is it possible?

    SELECT EntryDate,SupplyDate,SUM(Weight) AS Weight

    FROM tblCartons

    WHERE (ItemCode = '0117') AND (EntryDate = '2012-11-14') AND (SupplyDate <> '2012-11-16')

    GROUP BY EntryDate,SupplyDate,weight

    output from above

    EntryDateSupplyDateWeight

    2012-11-14 00:00:00.0002012-11-15 00:00:00.000790

    ------------------------------------------------------------------

    SELECT EntryDate,SupplyDate,SUM(Weight) AS Weight

    FROM tblCartons

    WHERE (ItemCode = '0117') AND (EntryDate = '2012-11-14') AND (SupplyDate = '2012-11-16')

    GROUP BY EntryDate,SupplyDate,weight

    EntryDateSupplyDateWeight

    output from above

    2012-11-14 00:00:00.0002012-11-16 00:00:00.00010

  • What does your final expected output look like?


    Kingston Dhasian

    How to post data/code on a forum to get the best help - Jeff Moden
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply