Forum Replies Created

Viewing 15 posts - 46 through 60 (of 101 total)

  • RE: comma delimited list problem

    I should have tidied that up a bit...

    select systemID, locations = substring((select ',' + Locations from #Address WHERE systemID = A1.systemID FOR XML PATH('')),2,1024)

    from #Address A1

  • RE: comma delimited list problem

    Roger, Is this the sort of thing you are after?

    create table #Address (systemID int, Locations varchar(16))

    insert #Address select 1001, 'CA'

    union all select 1001, 'ML'

    union all select 1001, 'IL'

    union...

  • RE: Using a variable with IN

    You need a function to split your comma separated variable into a table variable.

    CREATE FUNCTION [dbo].[SplitList]

    (

    @List varchar(8000),

    @splitter varchar(2)

    )

    RETURNS

    @ParsedList table

    (

    num int identity(1,1),

    item varchar(1024)

    )

    AS

    BEGIN

    SET @List = @splitter + LTRIM(RTRIM(@List)) + @splitter

    INSERT...

  • RE: help

    By the way, access has a built in query builder. In the CREATE menu in access 07 click on QUERY WIZARD.

    Bevan

  • RE: help

    Thanks.... Now can you post your attempted SQL and an explanation of what is not working (or any error codes that were returned)

    Bevan

  • RE: Query help - update duplicate rows

    Hi ,

    You can do this by joining to a cte. Note that you need to join on both reportName and UserID otherwise you will run into trouble...

    Firstly run the...

  • RE: help

    Hi ,

    You will need to post some more information before we can help you. Please provide your table design and some sample data. It is best to provide...

  • RE: Insert into Table from Table

    hi,

    Here is an example you can hopefully build a script from. just change the table names and columns.

    insert names2 (fname, lname) select fname, lname from names

    truncate table names

    You will...

  • RE: Month Total and Year Total per item

    hi,

    Using rollup may help. Just add with rollup after your GROUP BY

    http://msdn.microsoft.com/en-us/library/ms189305(SQL.90).aspx

    Bevan

  • RE: Treeview Select

    Hmmm, I'm afraid you've exhausted my brain! Does anyone else have any solutions?

  • RE: Treeview Select

    Try adding

    option (maxrecursion 1000)

    to the very end

    Bevan

  • RE: Treeview Select

    The trick is that you cannot have any other select statements before a CTE. So, although the code is correct, it cannot be run all together.

    Run the first part...

  • RE: Treeview Select

    Hi Rog,

    I had this written up and forgot to post it before going off to lunch!

    Anyway, I have a working example for you. It uses a recursive CTE. ...

  • RE: Select latest description from table

    I see Noel and I posted almost identical answers on the first question!

    Heres one way to update the values...

    --- Have a look at new and old data side by...

  • RE: Select latest description from table

    Hi,

    you need to use the row_number function to identify which specific rows you want returned. Change the order by clause if you want the oldest record.

    create table # (SKU# varchar(10),...

Viewing 15 posts - 46 through 60 (of 101 total)