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 Mike Lewis 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.

    I'm sorry about that. Here it is again. ALTER procedure [dbo].[GetDDSInfo]--'s0b' @doc varchar (3) as DECLARE @ddsgroup varchar(3) --set ddsgroup gets ddsgroup from natdocfile2 SELECT @ddsgroup = DDSGroup FROM NatDocFile2 where doc = @doc if @doc = @ddsgroup Begin WITH Base AS ( SELECT...
  2. nc297

    Else statement not picking up.

    Thank you this does make sense. I revised it and now getting results from both queries. ALTER procedure [dbo].[GetDDSInfo]--'s0b' @doc varchar (3) as DECLARE @ddsgroup varchar(3) --set ddsgroup gets ddsgroup from natdocfile2 SELECT @ddsgroup = DDSGroup FROM NatDocFile2 where doc = @doc if...
  3. nc297

    Else statement not picking up.

    What am I doing wrong? I tried this and now it is giving me one result but just the top one. The else statement is not picking it up. ALTER procedure [dbo].[TestDDS]--'s0b' @doc varchar(3) as DECLARE @ddsgroup varchar(3) SELECT @ddsgroup = DDSGroup FROM NatDocFile2 where doc = @doc if...
  4. nc297

    Help with Query

    Could you please explain what row_number and ranked are doing in the query? ;WITH Base AS ( SELECT p.DOC, p.Reg, p.FO, p.CLMS, --getting age of case when it was filed DATEDIFF(DAY, MAX(p.filedate), GETDATE()) AS Age, MAX(FileDate) AS FileDate...
  5. nc297

    Help with Query

    Markros you were right someone helped me with this and used row_number. ;WITH Base AS ( SELECT p.DOC, p.Reg, p.FO, p.CLMS, --getting age of case when it was filed DATEDIFF(DAY, MAX(p.filedate), GETDATE()) AS Age, MAX(FileDate) AS FileDate...
  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

    Okay yes I see the difference. I will keep this just in case they come back and want this veiw. Thanks again! Have another problem... When you select a botton how do I show the claims for the botton they selected. This query shows 250. Do I add a parameter to show 300 cases, 350 cases...
  13. nc297

    Help with stored procedure

    Mark, this one worked better for me. Thanks so much. Can you please explain what it's doing: select doc, [250]=SUM([250]), [300]=SUM([300]), [350]=SUM([350]), [400]=SUM([400]) from ( SELECT doc, [250] = case when [Days] between 250 and 299 then cnt else 0 end...
  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

    The way this stored procdure is set up it produces this: doc cnt S09 1 S09 2 S09 9 S09 51 S0B 1 S0B 4 S0B 16 S0B 57 How do I change it to give me results as this? Doc 250 300 350 400 S09 1 2 9 51 S0B 1 4...
  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