Forum Replies Created

Viewing 15 posts - 3,391 through 3,405 (of 10,144 total)

  • RE: Unable to sum column values

    vigneshkumart50 (5/2/2014)


    No I don't get sum for 2 nd column

    Have you checked to see if the values actually exist?

    SELECT *

    FROM (VALUES (CAST(0 AS DECIMAL(10,4)),CAST(0 AS DECIMAL(10,4))), (10,100), (20,NULL), (NULL,300),(40,400)

    )...

  • RE: Running Totals Problem

    You're welcome. Bear in mind that the triangular join method should only be applied when the partitions are many and small relative to the whole affected set, and you should...

  • RE: Can I convert a string to a time field ?

    You're welcome, you too! It's a bank holiday weekend here 🙂

  • RE: Running Totals Problem

    Jeff Moden's paper here [/url]will show you how to correctly set up a Quirky Update, included iirc a partitioned update, which requires an extra variable. There are a few rules...

  • RE: Left outer Join

    Which table contains the column which holds 'sales cost unit price'?

  • RE: Is there a fast way for SQL to do a Group By Count on items within a group?

    Have you thought about how the TOP(15) requirement will work? What if your user wants to see - and expand - a state node which isn't in the top 15?

    Mimicing...

  • RE: Calling stored procedures in query

    Only with major trickery, not recommended.

    You could INSERT INTO #temp (column_list) EXEC sp, or alternatively reform the sp as a table-valued function, preferably inline.

  • RE: Remove decimal values

    vigneshkumart50 (5/2/2014)


    the datatype is decimal(10,4)

    Current Value:

    12,589.25

    Expected Output:

    12,589

    Always truncating, never rounding? What about 12,589.99?

    Your expected output omits a '$' character present in your first post, do you want this or...

  • RE: Need help with query rewrite

    shahgols (5/1/2014)


    Hi all,

    We have a very expensive query that I am tring to rewrite, but the rewritten query (even though is much faster) doesn't return the same number of...

  • RE: Can I convert a string to a time field ?

    SELECT

    Starttime = CAST(Starttime AS TIME),

    Endtime = CAST(Endtime AS TIME),

    MinutesElapsed = DATEDIFF(minute, CAST(Starttime AS TIME), CAST(Endtime AS TIME))

    FROM (SELECT Starttime = '09:45 AM', Endtime = '10:15 AM') d

  • RE: Remove decimal values

    vigneshkumart50 (5/2/2014)


    Hi,

    I am using this query to show my column as money and I need to remove the decimal values on top of this query

    Query:

    '$ '+ Replace(CONVERT(varchar,CAST(Finance_Report As money),1),'.00','') as...

  • RE: forming a dynamic query

    ssurekha2000 (5/1/2014)


    i think query is unclear

    Transcation tbl has transcationdate, amount and cid

    Mas_C has cid and cname

    Transcation date displayed will be from & todate passed from the application

    1) the output...

  • RE: Some Data Coming as NULL in a VIew

    Bhaskar.Shetty (5/2/2014)


    Hi,

    the case condition for Measure_% is failling for the conditions applied, Add a Else section for the case where not a single condition matches True.

    Thanks.

    Unlikely - check the...

  • RE: forming a dynamic query

    You forgot to initialise @strqry to something other than null. Since it ultimately gets concatenated to everything, the end result is null.

    You've got three completely separate queries in there....

  • RE: Need Assistance for Groups and Islands Problem

    DROP table #sample

    create table #sample (rowguid int identity ,id_frm int ,id_to int)

    insert into #sample values( 1,5)

    insert into #sample values( 7,13)

    insert into #sample values( 17,20)

    insert into #sample values( 30,1962)

    SELECT...

Viewing 15 posts - 3,391 through 3,405 (of 10,144 total)