Forum Replies Created

Viewing 15 posts - 6,856 through 6,870 (of 15,381 total)

  • RE: Select record from group

    adonetok (9/12/2013)


    How to post ddl?

    I list the sample data and result I need again as below.

    Come on...this isn't the first time we have asked you for ddl and sample data....

  • RE: Select record from group

    adonetok (9/12/2013)


    No, this result is not right.

    If I use this query, the result is not same as I expected.

    Then maybe you should post ddl, sample data and desired output so...

  • RE: Delay in Update Large Table Wtih Trigger

    Your trigger does not support multiple rows correctly. If you have more than 1 row in inserted you will only have a single value in your variables. You need to...

  • RE: Delay in Update Large Table Wtih Trigger

    Can you post the entire trigger code? I don't see in this trigger any reference to inserted or deleted. I also see a bunch of variables. That gives me a...

  • RE: How to add this condition into where clause? Thanks.

    This should work.

    where doctype = 1

    or doctype = case @dt when 1 then 2 end

  • RE: Select record from group

    You don't need a bunch of steps for this. A simple query (that you pretty much wrote) will do this in a single step.

    select ID, min(DATEFROM),max(DATETO),Color

    group by ID, Color

  • RE: variable product costing

    Happy to help. You might want to read up on APPLY.

    Paul White has a 2 part series that is the best I have read on the subject.

    http://www.sqlservercentral.com/articles/69953/%5B/url%5D

    http://www.sqlservercentral.com/articles/69954/%5B/url%5D

  • RE: I can't make heads nor tails of this....

    Jack Corbett (9/12/2013)


    below86 (9/12/2013)


    I agree with Sean's version. As you have found out this is a nightmare to figure out, it may work but it doesn't make...

  • RE: Exclude rows

    It would be a lot easier is you would provide ddl and sample data in a consumable format. Also, you should try to avoid reserved words for object/column names (all...

  • RE: Query Help

    DBA12345 (9/11/2013)


    Hi I want to update Flag column in second table based on the Adder names.

    If the Applicatiion has atleast one AIX and Adder name is UDB then the flag...

  • RE: Relation ship in SQL Server

    sreenubabu.s (9/12/2013)


    i want to create Primary key for 3 columns in parent table

    and foreign key in for 2 coloumns in child table.

    can i refer these 2 foreign key columns...

  • RE: Creating a CSV file from a Trigger

    SteveEClarke (9/12/2013)


    Well that has certainly opened up the can of worms -

    OK - The process I need to complete is as follows;

    When a Sales Order is Dispatched - I...

  • RE: variable product costing

    Given the changes here I don't think you need a case expression at all.

    Pretty sure this would give you the same results.

    SELECT s.Year, s.Customer, s.StockCode, s.MonthNo, s.Volume, x.Cost

    FROM [dbo].[tbl_volumes] s

    cross...

  • RE: Only functions and some extended stored procedures can be executed from within a function.

    krypto69 (9/11/2013)


    Hi,

    I have this function called fn_GetTimedKey() when I run it in my SQL2005 environment it works fine.

    When I run it in my SQL2008R2 environment I get the error:

    Only functions...

  • RE: variable product costing

    spin (9/11/2013)


    getting closer. sorry, if i add a 3rd costing i get the second cost carried forward. so...

    Year.........MonthNo.....Volume.....Cost

    2013........1................5000........1

    2013........2................4000........1

    2013........3................5000........1.5

    2013........4................2000........1.5

    2013........5................5000........1.5

    2013........6................3000........1.5

    2013........7................7000........1.5

    2013........8................5000........1.5

    2013........9................3000........1.5

    2013........10................7000........1.62

    2013........11................5000........1.5

    2013........12................9000........1.5

    --the query

    SELECT s.Year, s.Customer, s.StockCode, s.MonthNo, s.Volume,

    CASE

    WHEN Cost IS NULL THEN...

Viewing 15 posts - 6,856 through 6,870 (of 15,381 total)