Forum Replies Created

Viewing 15 posts - 9,541 through 9,555 (of 10,144 total)

  • RE: Conditional logic in a view

    Surely this is all you need?

    [font="Courier New"]SELECT t.*

    FROM TABLE t

    WHERE (IS_MEMBER('role') = 0 AND t.deletedate IS NULL) OR IS_MEMBER('role') = 1

    --OR ID IN (SELECT ID FROM table WHERE field...

  • RE: Populating an IDENTITY column

    It won't do any harm to have an identity column in your table, one which isn't populated with data from your spreadsheet but which is automatically assigned a value as...

  • RE: SELECT

    Here's a little sample data in case this thread is revisited.

    [font="Courier New"]SET NOCOUNT ON

    DROP TABLE #Entity

    CREATE TABLE #Entity (entity_id INT, template_id INT, [name] VARCHAR(20))

    INSERT INTO #Entity (entity_id, template_id, [name])

    SELECT...

  • RE: Subquery error!

    Thanks for the feedback Neil, good luck!

  • RE: Subquery error!

    Hi Neil

    I reckon this is what you want. Note that there were a couple of missing commas in the SELECT list.

    [font="Courier New"]SELECT CL1.CLIENT_UNO, CL1.NAME_UNO, MA1.MATTER_UNO, MA1.CLNT_MATT_CODE, CL1.CLIENT_NAME, NA1.[NAME],

       PE2.LOGIN,...

  • RE: Simple query to return weeks within date range

    Hi Glen

    You will probably find some useful material in the following post:http://www.sqlservercentral.com/Forums/Topic570892-145-1.aspx

    Cheers

    ChrisM

  • RE: Procedure

    Hi Ramya

    If you set up your formula expression as a string and EXECute it, then any variables defined in the calling batch will be out of scope to the batch...

  • RE: Procedure

    Hi Ramya

    Can't you run the statement as it is? I can't see a need for EXEC:

    [font="Courier New"]IF @AssessableValue > 0  

       SET @BED_BaseAmt = @AssessableValue * @Qty  

    ELSE  

       SET @BED_BaseAmt = @price...

  • RE: Procedure

    Hi Ramya

    You are getting this error message because the batch executed by the EXEC statement cannot reference variables declared in the batch from which it was called.

    You could use...

  • RE: Group by Date....

    Not at all b_boy, it's a learning experience for us all. How about posting up some sample data and results? Everybody would appreciate this.

  • RE: Use String Function

    'Number' is the Tally table - check the link in Matt's earlier post.

  • RE: help wit "IF" sub query

    John

    It's a bit of a guess, as Lynn has pointed out, but I reckon this is what you're looking for:

    DECLARE @x VARCHAR (5)

    SET @x = 'true'

    SELECT id1, id2, id3

    FROM...

  • RE: Using Joins and Derived tables

    It's too big a step in one go. You need to find out how many rows are returned by each temp table without aggregation, and in particular, how many rows...

  • RE: getting week number of the current year

    ALZDBA (9/19/2008)


    I'm used to that :w00t:

    1) married

    2) dba

    :D:):P:w00t::hehe:

    And if you have children you will lose your voice completely 😛

  • RE: Using Joins and Derived tables

    beruken (9/19/2008)


    I think I understand that. I was able to build the derived output but still had the problem with master table. IS it possible to keep this result in...

Viewing 15 posts - 9,541 through 9,555 (of 10,144 total)