Forum Replies Created

Viewing 15 posts - 6,616 through 6,630 (of 26,490 total)

  • RE: Need a logic

    thava (5/17/2014)


    i have posted my Table structure below

    DECLARE @Mtbl AS TABLE (id INT,Rid INT, DATA VARCHAR(10))

    DECLARE @Ctbl AS TABLE (id INT,Rid INT,Tdata VARCHAR(10))

    INSERT INTO @Mtbl

    VALUES

    (1,1,'test'),(1,2,'test'),(1,3,'test'),

    (2,1,'test'),(2,2,'test'),(2,3,'test'),

    (3,1,'test'),(3,2,'test'),(3,3,'test'),(3,4,'test'),

    (4,1,'test'),(4,2,'test'),(4,3,'test'),(4,4,'test')

    INSERT INTO @Ctbl

    VALUES

    (1,1,'Data1'),(1,2,'Data2'),

    (3,1,'Data3'),(3,4,'Data4')

    /****************Result would be like...

  • RE: How to use SSRS to format financial report using non-sequential account order

    Here is what I would do.

    I would create a table that lists the accounts that must be in a specific order with a sequence number for the order that that...

  • RE: Subquery with "OR" strange problem.

    It would help if you would post the DDL for the tables including index definitions and the actual execution plans of both the fast and slow queries as .SQLPLAN files.

  • RE: create a table using the value of a variable

    I still have no idea what you are trying to accomplish. Perhaps if you show us what you are trying to accomplish by providing us with DDL (CREATE TABLE...

  • RE: create a table using the value of a variable

    Sean Lange (5/15/2014)


    laercionb (5/14/2014)


    let's see if I can explain:

    Type want to do a range of staff.

    then have a table of date where I want to create a table...

  • RE: query help needed

    CELKO (5/14/2014)


    horse riding in ... clop, clop, clop, clop, clop > Everyone else is wrong!! My way is the only way!! < clop, clop, clop, clop, clop ......

  • RE: query help needed

    < horse riding in ... clop, clop, clop, clop, clop > Everyone else is wrong!! My way is the only way!! < clop, clop, clop, clop, clop ... horse...

  • RE: Fastest way to delete from a large table

    Maybe you aren't explaining this well or I just don't get it, but what are you trying to delete? You show us a select statement and the DDL for...

  • RE: Please help to reduce query time

    Is the temp table created on the fly (SELECT INTO) or is it predefined using CREATE TABLE and then populated with an INSERT INTO statement? If the later, what...

  • RE: Need to return a count per unique check in invoice table

    Hyabusact (5/13/2014)


    When I ran this code it update ALL the records to the same value.

    (These are the real table, field names)

    WITH BaseData as

    (SELECT vendorno, count(DISTINCT checkno) AS ChkCount

    FROM...

  • RE: Need to return a count per unique check in invoice table

    Here is the statistics of the Windowing function and the group by select queries.

    ********** Windowing function *********

    (3 row(s) affected)

    Table 'Worktable'. Scan count 3, logical reads 27, physical reads 0,...

  • RE: Need to return a count per unique check in invoice table

    Eirikur Eiriksson (5/12/2014)


    Quick solution

    😎

    Use tempdb;

    GO

    DECLARE @CUST_PAY TABLE

    (

    CustNO INT NOT NULL

    ,InvNO INT NOT NULL

    ,ChkNO INT NOT...

  • RE: Need to return a count per unique check in invoice table

    Give this a try.

    WITH BaseData as (

    SELECT CustNO, count(DISTINCT ChkNo) AS ChkCount

    FROM CUST_PAY

    GROUP BY CustNO

    )

    update cust set

    CustPayments = bd.ChkCount

    from

    dbo.CustTab cust

    ...

  • RE: Parent-Child Grouping

    KGJ-Dev (5/12/2014)


    Hi,

    below is my table structure

    Create table ParentMember(IdParentMember int,Name varchar(40),company varchar(40))

    insert into ParentMember values (1,'Andrew','Microsoft'),

    (1,'Rob','IBM'),

    (1,'bob','SunMicro'),

    (1,'Peter','Oracle')

    Create table ChildMember(IdchildMember int,Name varchar(40),company varchar(40))

    insert into ChildMember values (100,'Andrew','Microsoft'),

    (101,'Blake','Microsoft'),

    (102,'Rob','IBM'),

    (103,'stanlye','IBM'),

    (104,'bob','SunMicro'),

    (105,'Peter','Oracle')

    (103,'Peter','Oracle')

    Required output:

    select 1 as IdParentMember,100 as IdchildMember,'Microsoft'...

  • RE: count events on date

    Eirikur Eiriksson (5/12/2014)


    ChrisM@Work (5/12/2014)


    Eirikur Eiriksson (5/12/2014)


    Mike Saunders NL (5/12/2014)


    Hi, this works! Thanks

    The only thing that is missing is that the days with no events are not mentioned. Is there a...

Viewing 15 posts - 6,616 through 6,630 (of 26,490 total)