Forum Replies Created

Viewing 15 posts - 61 through 75 (of 898 total)

  • RE: Column to Rows Sql help

    You can do the same using CROSS APPLY

    SELECT S.Batch, S.Account, S.Item, S.Ref, S.PageNo, F.ItemNo

    FROM sktrans AS S

    CROSS APPLY (

    ...

  • RE: YEAR TO DATE DATA

    The requirement is not really clear

    Can you please clarify it a bit further with some DDL, sample data to test against and the expected results

    You can check the link in...

  • RE: Does Apexatropin Actually Work?

    Spam. Reported.

  • RE: Exactly how N33 NITRIC OXIDE Job?

    Spam. Reported.

  • RE: Trying to write a query which fetches total net for sales order that are having same sales order as bevergaes

    The requirement is not very clear.

    We would need the table structure, some sample data and expected results in a easily consumable format.

    That would help us test the solution before giving...

  • RE: Insert values into single record

    Something like this...

    DECLARE@ShiftScheduler TABLE

    (

    [Date]DATE,

    EmpidINT,

    [Shift]TINYINT,

    [ShiftType]TINYINT

    )

    INSERT@ShiftScheduler

    SELECT'20140101', 1424, 2, 4 UNION ALL

    SELECT'20140102', 1424, 2, 4 UNION ALL

    SELECT'20140103', 1424, 2, 4 UNION ALL

    SELECT'20140104', 1424, 1, 2 UNION ALL

    SELECT'20140101', 1425, 1, 2

    SELECTEmpid,

    MAX( CASE WHEN DATEPART(...

  • RE: Converting getdate

    You don't need to convert the result of GETDATE() to some VARCHAR value to compare it with a date column. Declare a DATE variable and assign it the value of...

  • RE: CAN YOU USE 'CASE WHEN' WITH 'GROUP BY'?

    MarisaG (7/14/2014)


    Hi Kingston,

    Thank you very much, that's exactly what I was after.

    Such a simple way of doing it, but without your help I don't think I could have managed to...

  • RE: Link a column in each together with a foreign key

    As a start, you can look up JOINS in Google or Books Online.

    Please provide the DDL of both the tables involved and the names of columns you would like to...

  • RE: CAN YOU USE 'CASE WHEN' WITH 'GROUP BY'?

    This might help..

    SELECT Hole_ID, NAT_East, NAT_North, NAT_RL, Max_Depth, SUM( CASE WHEN Fe_pct > 57 THEN Interval ELSE 0 END ) AS Sum_Intervals

    FROM dbo.BCI_Step1_Test

    GROUP BY NAT_East, NAT_North, NAT_RL, Max_Depth, Hole_ID

  • RE: I need to Update a column with AutoNumber

    It would have better if you had provided some more information as the previous posts have suggested.

    Anyways, based on the limited information you have provided I think this is what...

  • RE: Script Help - Selecting last record

    Going by the query that you have provided in your original post, it doesn't look very difficult.

    It would be easier for people here to provide you solutions if you give...

  • RE: Calculating average

    As there was no DDL available , I assumed the DDL based on the first post

    DECLARE@Salary TABLE

    (

    EmpIdINT,

    JanNUMERIC(18,2),

    FebNUMERIC(18,2),

    MarNUMERIC(18,2),

    AprNUMERIC(18,2),

    MayNUMERIC(18,2),

    JunNUMERIC(18,2),

    JulNUMERIC(18,2),

    AugNUMERIC(18,2),

    SepNUMERIC(18,2),

    OctNUMERIC(18,2),

    NovNUMERIC(18,2),

    [Dec]NUMERIC(18,2)

    )

    INSERT@Salary

    VALUES( 1, 100.00, 200.00, 100.00, 200.00, 100.00, 200.00, 100.00, 200.00, 100.00, 200.00, 100.00, 200.00...

  • RE: Calculating average

    Its not a good table design. Change the design if possible.

    Please post some sample data and the DDL of the table involved.

    This would help people to come up with good...

  • RE: Report Non-existant child rows

    One more way to do the same thing..

    SELECTM.parcel, 0 AS [Count]

    FROM@m AS M

    WHERENOT EXISTS

    (

    SELECT*

    FROM@v AS V

    WHEREM.parcel = V.parcel AND V.value > 0

    )

Viewing 15 posts - 61 through 75 (of 898 total)