Forum Replies Created

Viewing 15 posts - 721 through 735 (of 1,346 total)

  • RE: Select single "child" row from complex query

    Without your table definitions, or sample data its difficult, but try this

    Select  TM_ASSN_Assignment.ASSN_AssnNum,

            TD_RECV_Recovery.RECV_Date,

            min(tblSavedForm.SavedDate),

            tblSavedForm.FormID,

            tblClientForm.ClientFormTitle

    FROM    #ValidAssignments

            INNER JOIN TM_ASSN_Assignment

                    on      assn_ids = ASSN_ID

            INNER JOIN TM_ASNA_AssignmentAsset

                   ...

  • RE: DTS Date Format issues

    Is the dateclocking column an actual datetime datatype? or is it a string?

    Try converting it

    Look at convert in books online.

    select max(convert(varchar(24),dateclocking,103)) from clockings

  • RE: using Dynamic SQL to get results from one table to use in another

    declare @sDate1 datetime

    declare @sqlstring varchar(1000)

    declare @ColName varchar(100)

    set @sDate1 = '09/11/2005'

    set @ColName = [Mick]

    set @sqlstring = 'select @sVar = ' + @ColName + '

    from table1

    where [date] = @sDate1'

    sp_executesql @sqlstring,N'@sDate1 datetime, @sVar...

  • RE: How do you handle dates with OpenXML

    Your going to have to perform manipulation to the date string application side prior to sending the xml to sql server.

    The value you have does not work.

    select convert(datetime,'2003-09-21T00:00:00.0000000+01:00')

    This does works

    select...

  • RE: Concatenate field based on unique id.

    Create an inline function

    -- =============================================

    -- Create scalar function (FN)

    -- =============================================

    IF EXISTS (SELECT *

        FROM   sysobjects

        WHERE  name = N'fn_ConcatStrings')

     DROP FUNCTION fn_ConcatStrings

    GO

    CREATE FUNCTION fn_ConcatStrings

     (@ID int)

    RETURNS varchar(500)

    AS

    BEGIN

    declare @String...

  • RE: SQL server does not exist or access denied: not a straight forward

    Did anything else change?

    Network/firewall changes?

    That error is generic, but indicates only a couple things.

    username wrong, but you checked that.

    Sql server authentication mode windows only, or sql and windows, but you...

  • RE: How do you handle dates with OpenXML

    What does one of the actual values look like?

    I have had this problem when the date was formatted funny, like ddmmyyyy you may have to format the date client side...

  • RE: Possible to do an Update/Select Like an Insert/Select?

    Look for Update From.

    Update mytable

    set col1 = somevalue

    From SomeTable

    Join mytable on somecol = othercol

     

    please present table, data, and your expected results and someone should be able to help

  • RE: Fill View based on null criteria?

    Please provide more information about your data. But I think this will work.

    Create view my_EN_view

    as

    select ID, Case when Name_EN is null then name_FR else NAME_EN  end as NAME_EN

    From MyNameTable

    Create view...

  • RE: How to increase time out in EM

    I don't know what you mean by timeout for looking at current activities.

    Basically it amounts to Enterprise manager was not really built to do what your trying to do, I...

  • RE: Trigger question - If Updated

    I'm not sure what your trying to do, but look in books online under create trigger, it describes a way to use columns updated with a bitwise to...

  • RE: Column Result to varchar?

    I do not recall this, What are you trying to do?

    Declare @String varchar(8000)

    set @String = ''

    Select @String = @String + mycolumn + ','

    from Mytable

    Something like this?

     

  • RE: Extract XML Data with TSQL from duplicate tags

    Medication is the parent in your xml string and does not have a value to outpt as a column in your recordset. This will return you all the info in...

  • RE: Grouping

    To get the results the way you want you;ll need to union.

    select Yr, sum(Case when AG between 1 and 20 then Total end) as 'Total', '1-20' as GRP

    from testtable

    group by...

Viewing 15 posts - 721 through 735 (of 1,346 total)