...p.DOC,
p.CLMS,
n.ddsstate,
d.ddscode
),
--getting results produced by the from clause
Ranked AS (
SELECT *,
-- return only the first rank which is 1
ROW_NUMBER() OVER(PARTITION BY clms ORDER BY FileDate DESC) AS rn
FROM Base)
SELECT *
FROM...
...p.DOC,
p.CLMS,
n.ddsstate,
d.ddscode
),
--getting results produced by the from clause
Ranked AS (
SELECT *,
-- return only the first rank which is 1
ROW_NUMBER() OVER(PARTITION BY clms ORDER BY FileDate DESC) AS rn
FROM Base)
SELECT *
FROM...
...n.ddsgroup,
p.DOC,
p.CLMS,
n.ddsstate),
--getting results produced by the from clause
Ranked AS (
SELECT *,
-- return only the first rank which is 1
ROW_NUMBER() OVER(PARTITION BY clmssn ORDER BY FileDate DESC) AS rn
FROM Base)
SELECT *
FROM Ranked...
...filedate, GETDATE()) > 300 )
GROUP BY p.fo,
p.Reg,
p.DOC,
p.CLMS,
),
Ranked AS (
SELECT *,
ROW_NUMBER() OVER(PARTITION BY clms ORDER BY FileDate DESC) AS rn
FROM Base)
SELECT *
FROM Ranked
WHERE rn = 1
ORDER BY clms, age DESC;
...GETDATE()) > 300 )
GROUP BY p.fo,
p.Reg,
--n.regionacronym,
p.DOC,
p.CLMS,
),
Ranked AS (
SELECT *,
ROW_NUMBER() OVER(PARTITION BY clms ORDER BY FileDate DESC) AS rn
FROM Base)
SELECT *
FROM Ranked
WHERE rn = 1
ORDER BY clms, age DESC;
Take a look at clms - 125987
I would like for only one record to show (out of the two of 125987). The one I want is the filedate of 05/06/2011.
I tried min(clms) = max(clms) and min(FO) <> max(FO) and min(Filedate) <> max(filedate) and Title <> title then 'concurr' else title end
This...
Actually that gave me the same results.
My problem is I have two clms that have the same number but the FO, Filedate and Title are different. So how could I add to the statement below to say if clms is the same and FO, Fieldate and Title are different take the min(filedate) (which would only...
I don't know why I'm receiving different counts:
This query gives me a count of 16 records that are over 300
Select p.doc,
COUNT(distinct CASE WHEN Datediff(DAY, filedate, Getdate()) > 250 THEN clms END) AS [250],
COUNT(distinct CASE WHEN Datediff(DAY, filedate, Getdate()) > 300 THEN...
How can I add this to the case statement of the query or just to the query to check...
If fileddate <> filedate then use the min filedate and place in the title field the word 'concurr' for the one record.
I have this query doing it already but it does it for filedates matching.
Select...
Here's some table information
This query:
SELECT
doc,
COUNT(*) AS cnt
FROM
(
Select
doc
FROM testpend p
Group By
doc, clms ) AS T
GROUP BY
doc
Produces this:
doc cnt
S0L 3
S11 2
S23 2
This query:
select...
...DDSAge = Datediff(day,min(ddsrcpt), getdate()),
Title = case when min(p.Title) <> max(p.Title) then 'Concurr' else min(p.Title) end
From
(select *, row_number() over (Partition by ddsrcpt order by ddsrcpt) as rownum
from pendingdds) p
join offices.dbo.doorsinfo o
on o.officecode = p.fo...
...and 399 then cnt else 0 end,
[400] = case when [days] >= 400 then cnt else 0 end
from (
SELECT
doc, cnt=COUNT(*),
[days]=Datediff(Day, filedate, Getdate())
FROM pendingdds p
join Offices.dbo.OfficeCodes d on d.officecode =...
No because I need one set of result at a time. So if you click on the 300 button I only want those cases that are over 300 days old and younder than 350 days old.
Thanks Mark this works well!
Now how would I grab all the 300 cases? Would I need a parameter? I have buttons called 300, 350 and 400 so when a user clicks on them I want them to change to display the info.
They are the same all of the time. I have radio buttons on the page so when I click on 300 I want the gridview to fill with the pending items that are between 300 - 350.
My export to excel works fine but now I'm trying to remove the hyperlink when it exports to excel. Here's the info:
Protected Sub BtnExportExcel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Response.Clear()
Response.Buffer = True...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.