Forum Replies Created

Viewing 15 posts - 406 through 420 (of 761 total)

  • RE: How to substract from one column to another ?

    sachince61 (5/21/2012)


    All of you thank you very much for reply....

    You're welcome. 🙂

    But, what worked??....it would be great if you could post the solution so that other people can also view...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: IN versus Equals

    pdanes (5/21/2012)


    Okay, got it. Thank you both, maybe I was thinking about the error 8623 mentioned on that page. Not a problem in my case, there can never be...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: difference between last(max) and penultimate(max-1) for each group

    Yes, mine was "way too over-complicated".

    Cadavre and Dwain....your queries were better.:-)

    Good work guyz.

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: IN versus Equals

    pdanes (5/21/2012)


    According to BOL, an IN clause is the same as the different elements with OR constraints.

    Oh? I didn't know that, and I seem to remember reading that multiple ORs...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: How to substract from one column to another ?

    Looks good Dwain.

    But, I'm still unsure what the OP wants....so will say something after the OP elaborates upon the requirement a little. 🙂

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: IN versus Equals

    SELECT ... WHERE fld in ('aaa','bbb','ccc')

    The above query(for understanding can be written as):

    SELECT ... WHERE fld = 'aaa' OR fld = 'bbb' OR fld = 'ccc'

    Which means that Sql Server...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: How to substract from one column to another ?

    What do you mean by "First CheckOut Row" and "Second CheckOut Row"??

    From what I understood(that "First CheckOut Row" is the first row ordered by "CheckOut" and "Second CheckOut Row" is...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: how to write a select query with out passing parameter for this tables ?

    Gullimeel (5/21/2012)


    these should give u desired results

    --first query

    select t1.categoryname ,count(*) categorycount from @table1 t1

    inner join @table2 t2

    on t1.catid= t2.catid

    inner join @table3 t3

    on t2.sid = t3.sid

    group by t1.categoryname

    --second query

    select...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: difference between last(max) and penultimate(max-1) for each group

    gelu01 (5/19/2012)


    Lowell (5/19/2012)


    that would work or not work depending on the data, right vinu?

    if the data elements are consecutive numbers, but if they are not, i don't think you get...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: difference between last(max) and penultimate(max-1) for each group

    Lowell (5/19/2012)


    that would work or not work depending on the data, right vinu?

    if the data elements are consecutive numbers, but if they are not, i don't think you get the...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: difference between last(max) and penultimate(max-1) for each group

    This would do it:

    --Creating Table

    Create Table Ex

    (Col1 char(1),

    Col2 int )

    --Inserting Sample Data

    Insert Into Ex

    Select 'a', 1

    Union ALL

    Select 'a', 2

    Union ALL

    Select 'a', 3

    Union ALL

    Select 'b', 5

    Union ALL

    Select 'b', 6

    Union ALL

    Select...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: Next Previous and current rows

    There is no "Spoon" and there is no 11th row....:-D

    Please tell us the Logic(if any) that got you the Desired Result Set from the Sample Data.

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: Passing parameter Dynamically to Open Query inside Function

    I completely agree with you, Matt. You are right about the limitations of a Function and the problems one might run into by using such techniques.

    This was just an attempt...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: Result to a variable

    You can do it using Table Variables. The following link might be helpful for you:

    Table Variables

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: Passing parameter Dynamically to Open Query inside Function

    Matt Miller (#4) (5/17/2012)


    preetham gowda (5/17/2012)


    Try it

    Create Function dbo.Fun_Proc_Test1(@id1 int) Returns varchar(30)

    As

    Begin

    Declare @res varchar(30)

    --Set @res = (Select * From OpenQuery(ABHI, N'Declare @result varchar(30) Exec Abhi.Test.dbo.convert2Lower @id = ' + Cast(@id1...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

Viewing 15 posts - 406 through 420 (of 761 total)