three select statement

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • intscript
    New Member
    • Nov 2006
    • 18

    #1

    three select statement

    Hi Anybody,

    is this select statement is possible.

    select nQtyOut, nQtyIn
    from (
    Select sum(a.nQtyOut) nQtyOut from
    tbl_StationData a, tbl_Materials b
    where b.dtFinished is not null and a.vcSONo = b.vcSONo and a.nStationId = '11' and
    convert(datetim e, convert(varchar , b.dtFinished, 101)) = '12/04/06' and
    Select sum(a.nQtyIn) nQtyIn from
    tbl_BatchQty a, tbl_Materials b
    where b.dtFinished is not null and a.vcSONo = b.vcSONo and a.nStationId = '4' and
    convert(datetim e, convert(varchar , b.dtFinished, 101)) = '12/04/06' )

    Thanks
  • xpcer
    New Member
    • Jul 2006
    • 51

    #2
    Originally posted by intscript
    Hi Anybody,

    is this select statement is possible.

    select nQtyOut, nQtyIn
    from (
    Select sum(a.nQtyOut) nQtyOut from
    tbl_StationData a, tbl_Materials b
    where b.dtFinished is not null and a.vcSONo = b.vcSONo and a.nStationId = '11' and
    convert(datetim e, convert(varchar , b.dtFinished, 101)) = '12/04/06' and
    Select sum(a.nQtyIn) nQtyIn from
    tbl_BatchQty a, tbl_Materials b
    where b.dtFinished is not null and a.vcSONo = b.vcSONo and a.nStationId = '4' and
    convert(datetim e, convert(varchar , b.dtFinished, 101)) = '12/04/06' )

    Thanks

    select nQtyOut, nQtyIn
    from (
    Select sum(a.nQtyOut) nQtyOut from
    tbl_StationData a, tbl_Materials b
    where b.dtFinished is not null and a.vcSONo = b.vcSONo and a.nStationId = '11' and
    convert(datetim e, convert(varchar , b.dtFinished, 101)) = '12/04/06'
    UNION ALL
    Select sum(a.nQtyIn) nQtyIn from
    tbl_BatchQty a, tbl_Materials b
    where b.dtFinished is not null and a.vcSONo = b.vcSONo and a.nStationId = '4' and
    convert(datetim e, convert(varchar , b.dtFinished, 101)) = '12/04/06' )

    Comment

    Working...