Devam Ediyor

Small fix in a SP for a website developed in ASP.NET,c# and SqlServer

USE [DOLLARDAYS]

GO

/****** Object: StoredProcedure [dbo].[dd_admin_tmporder_list_v20120724] Script Date: 04/15/2013 11:47:55 ******/

SET ANSI_NULLS OFF

GO

SET QUOTED_IDENTIFIER OFF

GO

ALTER PROCEDURE [dbo].[dd_admin_tmporder_list_v20120724]

@totalbegin money

,@totalend money

,@perpage int

,@pageno int

AS

declare

@strtotalbegin varchar(30)

,@strtotalend varchar(30)

,@strperpage varchar(10)

,@strpageno varchar(10)

,@strnumrecs varchar(10)

select

@totalbegin = isnull(@totalbegin, $0.0000)

,@totalend = case when isnull(@totalend, 0) = 0 then $922337203685477.5807 else @totalend end

,@perpage = isnull(@perpage, 30)

,@pageno = isnull(@pageno, 0)

;with orderlist as (

select ROW_NUMBER() over (order by [url removed, login to view] desc) as RowNum

,[url removed, login to view]

,[url removed, login to view]

,RTRIM([url removed, login to view]) + ' ' + RTRIM([url removed, login to view]) + [url removed, login to view] as custname

,RTRIM([url removed, login to view]) + ' ' + RTRIM([url removed, login to view]) + [url removed, login to view] as repname

from (

select [url removed, login to view]

,[url removed, login to view]

,[url removed, login to view]

,[url removed, login to view]

,case when isnull([url removed, login to view], '')='' then '' else ' of ' + rtrim([url removed, login to view]) end as bizname

,[url removed, login to view]

,[url removed, login to view]

,case when d1.phonerepid=1 and [url removed, login to view] > 1 then '' else ' (Temp)' end as tempstatus

,[url removed, login to view]

from (

select [url removed, login to view]

,max([url removed, login to view]) as lastadd

,sum([url removed, login to view] * [url removed, login to view]) as total

from [url removed, login to view] toi1 with (NOLOCK)

where [url removed, login to view] > $0.001

group by [url removed, login to view]

) toi

inner join dbo.dd_rm00101 d1 with (NOLOCK) on [url removed, login to view] = [url removed, login to view]

inner join [url removed, login to view] r1 with (NOLOCK) on [url removed, login to view] = [url removed, login to view]

inner join [url removed, login to view] p1 with (NOLOCK) on (([url removed, login to view] = [url removed, login to view] and [url removed, login to view] 1))

where [url removed, login to view] > @totalbegin

and [url removed, login to view] < @totalend

) t

)

select [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view]

from orderlist ol

where [url removed, login to view] between (@perpage * @pageno + 1) and (@perpage * (@pageno+1))

order by [url removed, login to view]

GO

USE [********]
GO

/****** Object: StoredProcedure [dbo].[dd_admin_tmporder_list_v20120724] Script Date: 04/15/2013 11:47:55 ******/
SET ANSI_NULLS OFF
GO

SET QUOTED_IDENTIFIER OFF
GO



ALTER PROCEDURE [dbo].[dd_admin_tmporder_list_v20120724]
@totalbegin money
,@totalend money
,@perpage int
,@pageno int
AS

declare
@strtotalbegin varchar(30)
,@strtotalend varchar(30)
,@strperpage varchar(10)
,@strpageno varchar(10)
,@strnumrecs varchar(10)

select
@totalbegin = isnull(@totalbegin, $0.0000)
,@totalend = case when isnull(@totalend, 0) = 0 then $922337203685477.5807 else @totalend end
,@perpage = isnull(@perpage, 30)
,@pageno = isnull(@pageno, 0)


;with orderlist as (
select ROW_NUMBER() over (order by t.lastadd desc) as RowNum
,t.custnmbr
,t.total
,RTRIM(t.custname) + ' ' + RTRIM(t.cntcprsn) + t.bizname as custname
,RTRIM(t.fname) + ' ' + RTRIM(t.lname) + t.tempstatus as repname
from (
select d1.custnmbr
,toi.total
,r1.custname
,r1.cntcprsn
,case when isnull(r1.stmtname, '')='' then '' else ' of ' + rtrim(r1.stmtname) end as bizname
,p1.fname
,p1.lname
,case when d1.phonerepid=1 and d1.tmprepid > 1 then '' else ' (Temp)' end as tempstatus
,toi.lastadd
from (
select toi1.clientid
,max(toi1.startdate) as lastadd
,sum(toi1.price * toi1.quantity) as total
from dbo.tmporditem toi1 with (NOLOCK)
where toi1.price > $0.001
group by toi1.clientid
) toi
inner join dbo.dd_rm00101 d1 with (NOLOCK) on toi.clientid = d1.custnmbr
inner join dbo.rm00101 r1 with (NOLOCK) on d1.custnmbr = r1.custnmbr
inner join dbo.phonerep p1 with (NOLOCK) on ((d1.phonerepid = p1.phonerepid and d1.tmprepid < 2) or (d1.tmprepid = p1.phonerepid and d1.tmprepid > 1))
where toi.total > @totalbegin
and toi.total < @totalend
) t
)
select ol.custnmbr, ol.total, ol.custname, ol.repname
from orderlist ol
where ol.RowNum between (@perpage * @pageno + 1) and (@perpage * (@pageno+1))
order by ol.RowNum


GO


Beceriler: .NET, C# Programlama, Veri Tabanı Yönetimi, Yazılım Mimarisi, SQL

Daha fazlasını görün: price for a website, p1 group, order a developed website, c for int, case-net, case net, toi, small fix on, c and c++, c and c ++, net sql script, website sqlserver, asp small script, sql select order, sql select script, sql int date, website temp, temp website, website sql end, max net, website developed, sql script net, csv data sqlserver asp net, backup sqlserver asp net, fix money order

İşveren Hakkında:
( 4 değerlendirme ) new delhi, India

Proje NO: #4431705

Seçilen:

sumon355

Hello, I am interested to do this work. Thanks

10$ USD / saat
(34 Değerlendirme)
4.1

6 freelancer bu iş için ortalamada 42$/saat teklif veriyor

truongngocthanh

Hello, I can do it right now. Thank you.

8$ USD / saat
(17 Değerlendirme)
4.7
itresumesha

lets start now

3$ USD / saat
(7 Değerlendirme)
2.9
d0tnet12

Hi, i can develop this for [url removed, login to view] will find me on skyp,e : bujhbe

200$ USD / saat
(3 Değerlendirme)
2.5
cssolution

Hi ... I am agree to do this work accurately. Please check your PM.

3$ USD / saat
(0 Değerlendirme)
0.0
shaeed019208789

Hello, I think I can help you. Its short time work for me. Just contact with me. Thanks

30$ USD / saat
(0 Değerlendirme)
0.0