Click here to Skip to main content
14,599,112 members
Rate this:
Please Sign up or sign in to vote.
See more: , +
Hello friends i am preparing stock report in a project.

currently it is like this

[date] [opening stock] [sent qty] [ rec qty] [ closing stock]
1 april 2012 22 4 18
1 april 2012 18 10 28
2 april 2012 28 6 22
2 april 2012 22 100 122


but it should display like this
[date]           [opening stock]         [sent qty]    [ rec qty]          [ closing stock]

1 april 2012 22 4 --- --

------------ --- ---- 10 28
2 april 2012 28 6 ---- ----

------------- ---- ----- 100 122

(Here opening stock, closing stock should not repeat for a single date.)
friends can you please help me in showing data in correct format in gridview
thanks in advance friends
Posted
Updated 23-Aug-12 19:39pm
v7
Comments
veenusethi 24-Aug-12 1:30am
   
please explain your question in detail

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

try below query:-

select dt, opening_stock, sent_qty, rec_qty, closing_stock  from (
select dt, opening_stock, sent_qty, null rec_qty, null closing_stock ,dt as dt1 from users
union all
select null dt, null opening_stock, null sent_qty, rec_qty,  closing_stock , dt as dt1 from users
) a
order by dt1

*your [date] field is dt here

now you can bind it to gridview..
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100