Forum Replies Created

Viewing 15 posts - 121 through 135 (of 761 total)

  • RE: how to Pivot this

    yuvipoy (12/26/2012)


    hi

    i am having two tables one table is having header details and another is having data

    Table_idCol_1Col_2 Col_3Col_4 Col_5Col_6

    1Mytab_1_1NULL Mytab_1_2NULL Mytab_1_3 ...

  • RE: SQL Server Pivot tables

    Is this what you are looking for?

    --Creating Tables

    Create Table Store_Audit_Type

    (

    Audit_Type_Id Int,

    Audit_Type_Description NVarchar(30)

    )

    Create Table Store_Audit_Details

    (

    StoreId Int,

    Audit_Type_Id Int,

    CreatedDate Date

    )

    --Inserting Sample Data...

  • RE: Finding a quote in a string

    Bhuvnesh (12/26/2012)


    vinu512 (12/24/2012)


    Lets drink then :

    Select Char(34) + Char(67) + Char(72) + Char(69) + Char(69) + Char(82) + Char(83)+ ' ' + Char(68) + Char(87) + Char(65) + Char(73) +...

  • RE: Query Help

    Sean Lange (12/21/2012)


    Excellent job posting ddl, sample date and desired output!!! I wish everybody would post their questions like this.

    Here is one way to do this.

    select * from #temp

    where cCurrentGradeCode...

  • RE: Monthly balance from two tables

    hemal_301080 (12/26/2012)


    🙂

    Thank Vinu Vijayan

    No probs Hemal....it was my bad.

  • RE: Monthly balance from two tables

    I'm sorry Hemal, there is a slight error in my query. If there is data for more than one year then the data would be grouped only according to month...

  • RE: Monthly balance from two tables

    hemal_301080 (12/26/2012)


    Thanks, this worked

    You're Welcome!! 🙂

    Anytime Lokesh. It was just a matter of Grouping the data before joining.

  • RE: Monthly balance from two tables

    This would do what you are looking for:

    Select p.Month, SUM(p.cramount) As Credit, SUM(q.dramount) As Debit From

    (

    Select b.voucherno, DATENAME(MM, a.dt) As Month, SUM(b.cramount) As cramount From voucher As a...

  • RE: t-sql 2008 avoid a cartesian product

    There are 3 tables which are: 1. a claims table by client number that has the duplicate data wtihin some of the rows. 2. a price table and 3. an...

  • RE: Happy Holidays 2012

    Happy Holidays to you too Steve..........I guess the others have already started.....anyways wishing everyone a Merry Christmas and a Happpy New Year!!!!!! 🙂

  • RE: Finding a quote in a string

    dwain.c (12/24/2012)


    vinu512 (12/24/2012)


    dwain.c (12/24/2012)


    vinu512 (12/20/2012)


    dwain.c (12/20/2012)


    vinu512 (12/20/2012)


    dwain.c (12/19/2012)


    Since quote is also CHAR(25), you can also do this:

    CHARINDEX(CHAR(25), string_column) > 0

    Single Quote is char(39) Dwain......if I am not wrong. 😉

    Looked like...

  • RE: Finding a quote in a string

    dwain.c (12/24/2012)


    vinu512 (12/20/2012)


    dwain.c (12/20/2012)


    vinu512 (12/20/2012)


    dwain.c (12/19/2012)


    Since quote is also CHAR(25), you can also do this:

    CHARINDEX(CHAR(25), string_column) > 0

    Single Quote is char(39) Dwain......if I am not wrong. 😉

    Looked like a single...

  • RE: help!!! calculate average rolling 4 last weeks

    Lidou123 (12/20/2012)


    Hi Vinu,

    thank U for your answer !!!

    I tested the script but I have an error !!! it is in french .

    Msg 116, Niveau 16, État 1, Ligne 8

    Une seule expression peut être spécifiée...

  • RE: How to determine which items in one table do not appear in a second table

    Melanie Peterson (12/20/2012)


    Thank you, Vinu! The EXCEPT statement is new to me. Always nice to learn something new.

    Yes it is always good to learn something new Melanie.

    And what is...

  • RE: Finding a quote in a string

    dwain.c (12/20/2012)


    vinu512 (12/20/2012)


    dwain.c (12/19/2012)


    Since quote is also CHAR(25), you can also do this:

    CHARINDEX(CHAR(25), string_column) > 0

    Single Quote is char(39) Dwain......if I am not wrong. 😉

    Looked like a single quote when...

Viewing 15 posts - 121 through 135 (of 761 total)