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 bkrike 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
  • Content: Threads
  • Order by date
  1. 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...
  2. 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...
  3. 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...
  4. 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...
  5. 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...
  6. 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...
  7. nc297

    Granting a session access to parts in a gridview

    If you are in session(DMXXX) I want you to have access to the row with links of 230, 243, 247. This person is in district 230 and oversees offices 243 and 247 so when you come on this page I want the person to have links. I have a querystring with dist so this one would come over as dist="230"...
  8. nc297

    Row Databound

    How do I find out the count of the underlined items. For instance which row and cell. State TotPend PendnFO PendnDDS MD 80 256 782 Area1 102 148 256 456 22 16 25 876 15 29 32 Is the underline row 3 and cell 1? I'm...
  9. nc297

    Joining two queries

    How do I join these two queries into one query? SELECT t.fo, ISNULL(COUNT(distinct t.cos), 0)AS pendinfo1 FROM t16pendall t WHERE (mft_POSN1_CD in('b','d') or (MFT_POSN1_CD='a' and aged_alien_rsw='y')) and t.cos not in (select cos from t16pendmvt) GROUP BY t.fo union...
  10. nc297

    validation

    How can I not allow the form to go through if the user selects "other" from the DDL and not enter in something in the textbox to describe other: How did you hear about us: <asp:RadioButtonList ID="RadionButtonList1" runat="server"> <asp:ListItem>Newpaper...
  11. nc297

    Regular expression for a text box

    What's the regular expression for a text box only to accept letters and no numbers? This isn't working for me. (/[^a-zA-Z]+/
  12. nc297

    Need help with code behind

    I have security on my page and want to use sessions to grant access. On the index.aspx.vb page I have Session("FO") =Data1.OfficeCode (my validation to get the FO) Session("Pos") = Data1.FnCode (my validation to get the Pos) Region FO >300 DDS >300 FO & DDS 250 - 300 PHI 626...
  13. nc297

    Pivot Table

    Could someone help me make this data Sort rpt apr pcnt apr icnt may pcnt may icnt 1 2 22.6 182866 23.4 152619 A 2 27.2 182866 23.4 65336 B 2 20.5 76509 27.4 69989 C 2 13.5 38917 13.5 34850 D...
  14. nc297

    Distinct and Count

    I want to count the distinct cos. This works just want to know if there is a way to put distinct and count together? SELECT distinct m.cos, t.fo, Isnull(COUNT(m.cos), 0) AS penddds300 FROM t16pendmvt m JOIN t16pendall t ON m.cossn = t.cos WHERE ( mvt_typ = 'R' ) AND (mvt_loc LIKE...
  15. nc297

    Help with Stored procedure please...

    How do I write this? if max(juris_mvt_seq_num) and org_id in the t2juristest table not like 'p%' then use the org_id1 in the t2dibtest2 table where max(dib_mvt_seq_num) to determine the location. I got this to get the max(juris_mvt_seq_num) from the t2juristest table: select...
  16. nc297

    Derived Column replace column

    In my table (T16) I have a column called FLG_CDT char(8) so the date in that column appears as 20100930 I want to change the date to appear as 9/30/2010 12:00:00 AM I've added a Data Flow Derived column In the Derived Column I selected replace FLG_CDT What do I put in the Expression field...
  17. nc297

    DTS and SSIS question

    We are not going to use our DTS 2000 packages anymore so now I need to connect to the DB2 Files (that are in the DTS 2000 Package) from connection manager in SSIS 2005. I opened the DTS package in SQL 2005 which is called T16Pend. I opened the DTS 2000 Package Designer and clicked on the arrow...
  18. nc297

    Help with Stored procedure please...

    In this table, if Clm and cos have the same numbers and Title = T16 and the other is T2 I want their titles to be called Concurr (this table is what I want the stored procedure to create) Doc Clm Cos FileDate Rcpt Title S66 454442 454442 06/03/2010 06/11/2010 Concurr...
  19. nc297

    Explanation of subqueries

    Hi could someone explain to me this sub query. The first select station is what I don't really understand why set it up this way? Select n.doc, ISNULL(PendinDDS,0) as PendinDDS from Nation n Left Join (Select t.Doc, ISNULL(Count(T.cossn), )) AS PendinDDS From (select max(SeqNum) as SeqNum...
  20. nc297

    Help getting percentages

    How could I write a stored procedure to get the percentages from dynamic columns and insert all of that into a new table? This table would grow once a month so Dec would be added next and so on. I would want to have all of the percentages for each month listed. So that column could be called...

Part and Inventory Search

Back
Top