Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: nc297
  • Order by date
  1. nc297

    Else statement not picking up.

    ...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...
  2. nc297

    Else statement not picking up.

    ...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...
  3. nc297

    Else statement not picking up.

    ...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...
  4. nc297

    Help with Query

    ...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;
  5. nc297

    Help with Query

    ...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;
  6. nc297

    Help with Query

    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...
  7. nc297

    Help with Query

    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...
  8. nc297

    Help with Query

    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...
  9. nc297

    Adding to case statement

    Thank you that worked!!!!
  10. nc297

    Adding to case statement

    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...
  11. nc297

    Help with Query

    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...
  12. nc297

    Help with stored procedure

    ...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...
  13. nc297

    Help with stored procedure

    ...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 =...
  14. nc297

    Help with stored procedure

    Thanks Mark I will try this in the morning and get back to you.
  15. nc297

    Help with stored procedure

    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.
  16. nc297

    Help with stored procedure

    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.
  17. nc297

    Help with stored procedure

    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.
  18. nc297

    Help with stored procedure

    ...results as this? Doc 250 300 350 400 S09 1 2 9 51 S0B 1 4 16 57 SELECT doc, COUNT(*) AS cnt FROM ( Select doc FROM pendingdds p join Offices.dbo.OfficeCodes d on d.officecode = p.doc where...
  19. nc297

    Export to excel and removing hyperlinks

    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...
  20. nc297

    Granting a session access to parts in a gridview

    Still having problems with this but someone here is helping me with it. Thanks for your help.

Part and Inventory Search

Back
Top