hello,

your help has so far solved my query, but now i need the output itemwise so that i can total it at the end of the page.

my desired output format is below
2012-03-01 09:51:00.000 1000 harI pa3`pura dva A 95 950 dva b 100 2500 NULL NULL NULL NULL NULL NULL
2012-03-01 09:51:00.000 1001 harI pa3`pura dva A 95 900 dva B 100 2550 NULL NULL NULL NULL NULL NULL
2012-03-02 09:50:00.000 1002 harI pa3`pura dva A 10 1500 dva b 20 2000 dva C 30 2500 dva D 40 3000

my table structure as below

CREATE TABLE [dbo].[item_sale](
[id] [int] IDENTITY(1,1) NOT NULL,
[shakhaname] [nvarchar](150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[tarik] [datetime] NULL,
[kharidarName] [nvarchar](150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[vaarasnaam] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[gaamName] [nvarchar](150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[itemcategory] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[itemname] [nvarchar](150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[utpadakName] [nvarchar](150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[biyaranvarg] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[paaknaam] [nvarchar](150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[paakvistar] [float] NULL,
[banavatlotno] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[vechanvigat] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[vechanbhavperkl] [float] NULL,
[vechanjatho] [float] NULL,
[kulkimmat] [float] NULL,
[billno] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[sale_type] [nvarchar](15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[sale_comm] [float] NULL,
[rahat_amt] [float] NULL,
[entry_dt] [datetime] NULL,
[entry_by] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[total_amt] [float] NULL,
CONSTRAINT [PK_cashmemo] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

and insert statements as below
insert into item_sale values('4rad','3/7/2012 13:21','dcdcd','','dcdc','j>taunaxk dva','dva 1','taru~a','','','0','dcdcd c','10','100','100','10000','1000','cashmemo','0','0','3/7/2012 13:22','hari','10000')
insert into item_sale values('4rad','3/12/2012 16:52','manv','','paT~apura','j>taunaxk dva','dva 1','taru~a','','','0','jkn nknk 9879878','12','25','100','2500','1001','cashmemo','0','0','3/12/2012 16:53','','2500')
insert into item_sale values('4rad','3/12/2012 16:55','p/vI~a','','moDera','j>taunaxk dva','dva 1','taru~a','','','0','cdv dfvfd vfd','0','25','10','250','1002','cashmemo','0','0','3/12/2012 16:56','','250')
insert into item_sale values('4rad','3/12/2012 16:55','p/vI~a','','moDera','j>taunaxk dva','dva 1','taru~a','','','0','cdv dfvfd vfd','12','25','12','300','1002','cashmemo','0','0','3/12/2012 16:56','','300')
insert into item_sale values('4rad','3/12/2012 18:16','fvfv','fvf vf','dvdvdfvdfv fdvfd','bIyar~a','dva n> 1','','','','0','fvfvff vfvf','150','20','100','2000','1500','cashmemo_1','0','0','3/12/2012 18:16','','2000')
insert into item_sale values('4rad','3/12/2012 18:32','dcdscdsc','','sdcdscdsc','bIyar~a','dva n> 1','','','','0','','','20','100','2000','1','rahat','40','500','3/12/2012 18:32','','1540')
insert into item_sale values('4rad','3/12/2012 18:36','fvfvfdvf','','fvfvfv','bIyar~a','dva n> 1','','','','0','','','20','100','2000','2','rahat','50','500','3/12/2012 18:36','','1550')
hope my question is clear for you to help me.... I have to display the results sorted by itemwise and total it row wise...