Forum Replies Created

Viewing 7 posts - 16 through 22 (of 22 total)

  • RE: Update with multiple conditions - Help needed

    Took me a little bit of thinking but quite simple in the end.

    Use this select statement as the source for an UPDATE query...

    SELECT

    M.*,

    'NewAmount' = (

    SELECT

    Amount

    FROM

    mytable

    WHERE

    [Date] = M.[Date]

    ANDAOD = DATEADD(mm,-1,M.AOD)

    )

    FROM

    mytable...

  • RE: script for insert

    Hello,

    Before I give you the script I should point out that it seems to me that your table CustPriceList is redundant. It is just a product of the tables Customer...

  • RE: Need help for the CASE statement

    As I suggested before, change the default value that the parameters have in your procedure.

    So instead of:

    CREATE PROCEDURE [dbo].[usp_EmpSearchResult]

    @EmpID Int =...

  • RE: Need help for the CASE statement

    I'm sorry but I really don't understand what the problem is. Perhaps you can post some sample data and sample parameter values and explain what result you expect to see....

  • RE: Need help for the CASE statement

    If you run this code below, you will see that if you set the @Parameter variable to NULL, all 3 rows are returned. If you set it to a value...

  • RE: Need help for the CASE statement

    I'm not entirely sure what your problem is but...

    You say that you are passing parameters (to be used in your WHERE clause by the looks of it) which may or...

  • RE: Insert into two tables, using generated primary key from first to insert into the second

    I don't know if this helped the original poster but it certainly helped me. Thank you all very much (I used Piotr's example pretty much as it was given as...

Viewing 7 posts - 16 through 22 (of 22 total)