M
Malik
Hi,
I Have Many Tables in my DataBase. Now I have Two Quries "QuerySales" And
"QueryDrVoucher"
When I Run my first Query "QuerySales", It shows result as Follow:
SaleId Date CustomerId CommId NoOfBags Rate
------------------------------------------------------------------------------
---------
1 19/02/09 2 1 50 410
3 19/02/09 2 2 50 450
3 19/02/09 2
4 19/02/09 2 3 50 350
5 19/02/09 2 4 50 2300
6 19/02/09 2 1 50 410
6 19/02/09 2 2 50 850
6 19/02/09 2 3 50 350
6 19/02/09 2 4 50 2300
8 19/02/09 3 2 50 410
8 19/02/09 3 3 50 410
9 19/02/09 1 1 50 410
38 17/02/09 2 2 2 2
Its Fine. Its Ok
And
When I Run "QueryDrVoucher" It Show the Following:
VouccherNo Voucher Date AccountNo DrAmount Narration
------------------------------------------------------------------------------
------------------
2 17/02/2009 2 50000 Cash Paid
3 17/02/2009 2 50000 Cash
4 17/02/2009 3 60000 Cash
5 17/02/2009 4 50000 Cash Paid
6 17/02/2009 2 10000 Cash Paid
7 17/02/2009 2 100000 Cash Paid
Its fine also.
Now the problem is in its Union Query. When i Run Their Union Query, It Show
the Following:
( May Be Results not Fil On This Screen, U can use the Following Link for A
ScreenShot)
http://www.geocities.com/zubair_malik10/Full.JPG
SaleId Date CustomerId CommId NoOfBags Rate VoucherNo VoucherDate AccountNo
DrAmount Narration
1 19/02/09 2 1 50 410 2 17/02/2009 2 50000 Cash Paid
3 19/02/09 2 2 50 450 2 17/02/2009 2 50000 Cash Paid
3 19/02/09 2 2 17/02/2009 2 50000 Cash Paid
4 19/02/09 2 3 50 350 2 17/02/2009 2 50000 Cash Paid
5 19/02/09 2 4 50 2300 2 17/02/2009 2 50000 Cash Paid
6 19/02/09 2 1 50 410 2 17/02/2009 2 50000 Cash Paid
6 19/02/09 2 2 50 850 2 17/02/2009 2 50000 Cash Paid
6 19/02/09 2 3 50 350 2 17/02/2009 2 50000 Cash Paid
6 19/02/09 2 4 50 2300 2 17/02/2009 2 50000 Cash Paid
38 17/02/09 2 2 2 2 2 17/02/2009 2 50000 Cash Paid
1 19/02/09 2 1 50 410 3 17/02/2009 2 50000 Cash
3 19/02/09 2 2 50 450 3 17/02/2009 2 50000 Cash
3 19/02/09 2 3 17/02/2009 2 50000 Cash
4 19/02/09 2 3 50 350 3 17/02/2009 2 50000 Cash
5 19/02/09 2 4 50 2300 3 17/02/2009 2 50000 Cash
6 19/02/09 2 1 50 410 3 17/02/2009 2 50000 Cash
6 19/02/09 2 2 50 850 3 17/02/2009 2 50000 Cash
6 19/02/09 2 3 50 350 3 17/02/2009 2 50000 Cash
6 19/02/09 2 4 50 2300 3 17/02/2009 2 50000 Cash
38 17/02/09 2 2 2 2 3 17/02/2009 2 50000 Cash
8 19/02/09 3 2 50 410 4 17/02/2009 3 60000 Cash
8 19/02/09 3 3 50 410 4 17/02/2009 3 60000 Cash
1 19/02/09 2 1 50 410 6 17/02/2009 2 10000 Cash Paid
3 19/02/09 2 2 50 450 6 17/02/2009 2 10000 Cash Paid
3 19/02/09 2 6 17/02/2009 2 10000 Cash Paid
4 19/02/09 2 3 50 350 6 17/02/2009 2 10000 Cash Paid
5 19/02/09 2 4 50 2300 6 17/02/2009 2 10000 Cash Paid
6 19/02/09 2 1 50 410 6 17/02/2009 2 10000 Cash Paid
6 19/02/09 2 2 50 850 6 17/02/2009 2 10000 Cash Paid
6 19/02/09 2 3 50 350 6 17/02/2009 2 10000 Cash Paid
6 19/02/09 2 4 50 2300 6 17/02/2009 2 10000 Cash Paid
38 17/02/09 2 2 2 2 6 17/02/2009 2 10000 Cash Paid
1 19/02/09 2 1 50 410 7 17/02/2009 2 100000 Cash Paid
3 19/02/09 2 2 50 450 7 17/02/2009 2 100000 Cash Paid
3 19/02/09 2 7 17/02/2009 2 100000 Cash Paid
4 19/02/09 2 3 50 350 7 17/02/2009 2 100000 Cash Paid
5 19/02/09 2 4 50 2300 7 17/02/2009 2 100000 Cash Paid
6 19/02/09 2 1 50 410 7 17/02/2009 2 100000 Cash Paid
6 19/02/09 2 2 50 850 7 17/02/2009 2 100000 Cash Paid
6 19/02/09 2 3 50 350 7 17/02/2009 2 100000 Cash Paid
6 19/02/09 2 4 50 2300 7 17/02/2009 2 100000 Cash Paid
38 17/02/09 2 2 2 2 7 17/02/2009 2 100000 Cash Paid
But I Want That The Data Should Be Shown in One of the Following:
http://www.geocities.com/zubair_malik10/Want1.JPG
http://www.geocities.com/zubair_malik10/Want2.JPG
http://www.geocities.com/zubair_malik10/Want3.JPG
I m Very Confused....
I Need this Union Query For My Report
Thanks
I Have Many Tables in my DataBase. Now I have Two Quries "QuerySales" And
"QueryDrVoucher"
When I Run my first Query "QuerySales", It shows result as Follow:
SaleId Date CustomerId CommId NoOfBags Rate
------------------------------------------------------------------------------
---------
1 19/02/09 2 1 50 410
3 19/02/09 2 2 50 450
3 19/02/09 2
4 19/02/09 2 3 50 350
5 19/02/09 2 4 50 2300
6 19/02/09 2 1 50 410
6 19/02/09 2 2 50 850
6 19/02/09 2 3 50 350
6 19/02/09 2 4 50 2300
8 19/02/09 3 2 50 410
8 19/02/09 3 3 50 410
9 19/02/09 1 1 50 410
38 17/02/09 2 2 2 2
Its Fine. Its Ok
And
When I Run "QueryDrVoucher" It Show the Following:
VouccherNo Voucher Date AccountNo DrAmount Narration
------------------------------------------------------------------------------
------------------
2 17/02/2009 2 50000 Cash Paid
3 17/02/2009 2 50000 Cash
4 17/02/2009 3 60000 Cash
5 17/02/2009 4 50000 Cash Paid
6 17/02/2009 2 10000 Cash Paid
7 17/02/2009 2 100000 Cash Paid
Its fine also.
Now the problem is in its Union Query. When i Run Their Union Query, It Show
the Following:
( May Be Results not Fil On This Screen, U can use the Following Link for A
ScreenShot)
http://www.geocities.com/zubair_malik10/Full.JPG
SaleId Date CustomerId CommId NoOfBags Rate VoucherNo VoucherDate AccountNo
DrAmount Narration
1 19/02/09 2 1 50 410 2 17/02/2009 2 50000 Cash Paid
3 19/02/09 2 2 50 450 2 17/02/2009 2 50000 Cash Paid
3 19/02/09 2 2 17/02/2009 2 50000 Cash Paid
4 19/02/09 2 3 50 350 2 17/02/2009 2 50000 Cash Paid
5 19/02/09 2 4 50 2300 2 17/02/2009 2 50000 Cash Paid
6 19/02/09 2 1 50 410 2 17/02/2009 2 50000 Cash Paid
6 19/02/09 2 2 50 850 2 17/02/2009 2 50000 Cash Paid
6 19/02/09 2 3 50 350 2 17/02/2009 2 50000 Cash Paid
6 19/02/09 2 4 50 2300 2 17/02/2009 2 50000 Cash Paid
38 17/02/09 2 2 2 2 2 17/02/2009 2 50000 Cash Paid
1 19/02/09 2 1 50 410 3 17/02/2009 2 50000 Cash
3 19/02/09 2 2 50 450 3 17/02/2009 2 50000 Cash
3 19/02/09 2 3 17/02/2009 2 50000 Cash
4 19/02/09 2 3 50 350 3 17/02/2009 2 50000 Cash
5 19/02/09 2 4 50 2300 3 17/02/2009 2 50000 Cash
6 19/02/09 2 1 50 410 3 17/02/2009 2 50000 Cash
6 19/02/09 2 2 50 850 3 17/02/2009 2 50000 Cash
6 19/02/09 2 3 50 350 3 17/02/2009 2 50000 Cash
6 19/02/09 2 4 50 2300 3 17/02/2009 2 50000 Cash
38 17/02/09 2 2 2 2 3 17/02/2009 2 50000 Cash
8 19/02/09 3 2 50 410 4 17/02/2009 3 60000 Cash
8 19/02/09 3 3 50 410 4 17/02/2009 3 60000 Cash
1 19/02/09 2 1 50 410 6 17/02/2009 2 10000 Cash Paid
3 19/02/09 2 2 50 450 6 17/02/2009 2 10000 Cash Paid
3 19/02/09 2 6 17/02/2009 2 10000 Cash Paid
4 19/02/09 2 3 50 350 6 17/02/2009 2 10000 Cash Paid
5 19/02/09 2 4 50 2300 6 17/02/2009 2 10000 Cash Paid
6 19/02/09 2 1 50 410 6 17/02/2009 2 10000 Cash Paid
6 19/02/09 2 2 50 850 6 17/02/2009 2 10000 Cash Paid
6 19/02/09 2 3 50 350 6 17/02/2009 2 10000 Cash Paid
6 19/02/09 2 4 50 2300 6 17/02/2009 2 10000 Cash Paid
38 17/02/09 2 2 2 2 6 17/02/2009 2 10000 Cash Paid
1 19/02/09 2 1 50 410 7 17/02/2009 2 100000 Cash Paid
3 19/02/09 2 2 50 450 7 17/02/2009 2 100000 Cash Paid
3 19/02/09 2 7 17/02/2009 2 100000 Cash Paid
4 19/02/09 2 3 50 350 7 17/02/2009 2 100000 Cash Paid
5 19/02/09 2 4 50 2300 7 17/02/2009 2 100000 Cash Paid
6 19/02/09 2 1 50 410 7 17/02/2009 2 100000 Cash Paid
6 19/02/09 2 2 50 850 7 17/02/2009 2 100000 Cash Paid
6 19/02/09 2 3 50 350 7 17/02/2009 2 100000 Cash Paid
6 19/02/09 2 4 50 2300 7 17/02/2009 2 100000 Cash Paid
38 17/02/09 2 2 2 2 7 17/02/2009 2 100000 Cash Paid
But I Want That The Data Should Be Shown in One of the Following:
http://www.geocities.com/zubair_malik10/Want1.JPG
http://www.geocities.com/zubair_malik10/Want2.JPG
http://www.geocities.com/zubair_malik10/Want3.JPG
I m Very Confused....
I Need this Union Query For My Report
Thanks