Forum Replies Created

Viewing 15 posts - 2,866 through 2,880 (of 15,381 total)

  • RE: Month name and year in sql

    I would suggest putting that type of formatting in your bar graph instead of in your sql. Formatting in the front end is best so you can maintain your dates...

  • RE: Adding New Row in Temp Table

    Let's start with formatting this so we can see what is going on.

    DECLARE childcur_inventory CURSOR

    FOR

    SELECT Structure_Number

    ,STATE

    ,Neighbor_State

    ,Border_Bridge_Structure_Number

    FROM #InventoryItems

    OPEN childcur_inventory

    FETCH childcur_inventory

    INTO @Structure_Number

    ,@State

    ,@Neighbour_State

    ,@Border_Bridge_Structure_Number

    WHILE @@FETCH_STATUS = 0

    BEGIN ---@@FETCH_STATUS = 0

    IF @Neighbour_State = 'CN'

    OR @Neighbour_State...

  • RE: Error Message: The column was specified multiple times for

    rirons04 (5/8/2015)


    What I have posted above is exactly what I am running. Is there something specific that I am missing?

    ~Ryan

    Run your code again, but before you do uncomment this line.

    --select...

  • RE: Count Null values in all columns in a table and group it by a column

    Marv2011 (5/8/2015)


    Its for research purposes. The table that I am analyzing is a back end table of a front end clinical survey. A null value means that question was skipped...

  • RE: Count Null values in all columns in a table and group it by a column

    Marv2011 (5/8/2015)


    Thanks for this!

    I sometimes work with large data sets where my tables have over 100 columns. Is there an easier way of doing this instead of 100 case statements?...

  • RE: DISTICT STATEMENT GET MY QEURY SLOW.

    GG_BI_GG (5/7/2015)


    Ok. I will look..

    But is there any option for a subqeury (COALESCE), CROSS APPLY...

    COALESCE is just another function and is not at all relevant here. Not sure how a...

  • RE: DISTICT STATEMENT GET MY QEURY SLOW.

    GG_BI_GG (5/7/2015)


    Tnx for the quick responds.

    Ye it still dont work.. I think Alvin's recommendation makes my qeury not quicker..

    Is there a better way to make my query syntax, on which...

  • RE: DISTICT STATEMENT GET MY QEURY SLOW.

    Lynn Pettis (5/7/2015)


    Sean Lange (5/7/2015)


    Lynn Pettis (5/7/2015)


    Sean Lange (5/7/2015)


    Alvin Ramard (5/7/2015)


    Try using the LEFT function instead of SUBSTRING to see if it will run any faster.

    The problem is for the...

  • RE: DISTICT STATEMENT GET MY QEURY SLOW.

    Lynn Pettis (5/7/2015)


    Sean Lange (5/7/2015)


    Alvin Ramard (5/7/2015)


    Try using the LEFT function instead of SUBSTRING to see if it will run any faster.

    The problem is for the first join they want...

  • RE: DISTICT STATEMENT GET MY QEURY SLOW.

    Alvin Ramard (5/7/2015)


    Try using the LEFT function instead of SUBSTRING to see if it will run any faster.

    The problem is for the first join they want the first character. For...

  • RE: DISTICT STATEMENT GET MY QEURY SLOW.

    GG_BI_GG (5/7/2015)


    I like to DISTINCT my column facc_bkey but that take a lot of time. This is very, very slow 🙁

    Select DISTINCT CAST(a.DATAAREAID AS NVARCHAR(4)) + '_' + CAST(a.ACCOUNTNUM AS...

  • RE: Date Help

    I was about to post my version but Lynn beat me to it. On second thought, I will post my version anyway. It is a very different approach from his...

  • RE: Date Help

    KGJ-Dev (5/7/2015)


    Hey sean,

    Thanks for your reply, i am sorry that i misspelled. it is 3 char month. JAN/FEB/MAR/APR/MAY/JUN...

    Any thought/ sample pelase

    What have you tried?

  • RE: Date Help

    KGJ-Dev (5/7/2015)


    Hi,

    I have column called DateDesc and the values are "Start JAN","END MAY", "Mid JUNE". Like this i have for all the months of the year.

    I needed to convert this...

  • RE: Storing Values for Bitwise &

    nick.latocha (5/7/2015)


    This was my prototype:

    create table #items (itemID varchar(10), statusID int)

    create table #statuses (statusName varchar(50), statusID int)

    insert into #items values ('Item 1',1|2|8)

    insert into #items values ('Item 2',1|4)

    select * from #items

    insert...

Viewing 15 posts - 2,866 through 2,880 (of 15,381 total)