Forum Replies Created

Viewing 15 posts - 76 through 90 (of 1,047 total)

  • RE: SUM function for subquery

    Just a Hit and Trial....

    ;WITH CTE AS

    (

    SELECT Top 1 Amount+VATAmount as Total

    FROM FAAccKitty WITH(NOLOCK) Where FAAccKitty.PlaceID=FAAccWinners.PlaceID AND FAAccKitty.TransType='PZ')))

    FROM FAAccWinners

    INNER JOIN Reservations WITH(NOLOCK) ON (Reservations.PlaceID = FAAccWinners.PlaceID)

    INNER JOIN Visitor...

  • RE: SUM function for subquery

    What error you get?

  • RE: SUM function for subquery

    Hi,

    If you post table structure with some dummy data and desired output it will be easy for us to help you....

  • RE: How to count months for these table with inner join of sql server 2000?

    raghuldrag (12/30/2013)


    Hi Friends

    My table looks like here

    create table estr

    (

    custo int,

    company varchar(20),

    inv_no int

    inv_create_date datetime

    )

    insert into estr(custo,company,inv_no,inv_create_date) values('10','XXX','PKIN/01/13-14','2013-03-01')

    insert into estr(custo,company,inv_no,inv_create_date) values('20','XX1','PKIN/03/13-14','2013-04-01')

    insert into estr(custo,company,inv_no,inv_create_date) values('20','XX1','PKIN/05/13-14','2013-04-10')

    insert into estr(custo,company,inv_no,inv_create_date) values('30','XXT','PKIN/15/13-14','2013-05-11')

    create table cust

    (

    company varchar(20),

    inv_no...

  • RE: I want to get one day before date from my table

    HI,

    I am posting a solution with some dummy data, hope it will help you

    DECLARE @table table (ID int identity(1,1), WorkDate datetime)

    INSERT INTO @table

    values

    ('2013-12-26 20:10:05.207'),('2013-12-27 18:10:05.207'),('2013-12-30 16:10:05.207')

    SELECT DATEADD(D,-1,WorkDate) FROM @table

    output:

    WorkDate

    2013-12-25...

  • RE: Problem with a query

    It will be good if you post table structure with some sample data and desired output...

    Plesse follow link in my signature...

  • RE: How yo make these two queires to one please

    As Christian suggested, it can easily be done using CTE

  • RE: How yo make these two queires to one please

    Please do not post duplicate post in different forums it will save other people time too..

  • RE: Problem with a query

    I am not able to understand your requirement...

    We will be able to help you if you post the table structure with some sample data and expected output

  • RE: Table Structure

    GilaMonster (12/26/2013)


    kapil_kk (12/24/2013)


    GilaMonster (12/24/2013)


    kapil_kk (12/24/2013)


    Should I drop unique constraint and make non clustered index only or add more column in unique constraint instead of creating another nonclustered index?

    If the index...

  • RE: predict the output

    Thanks for the question Thava 🙂

  • RE: Table Structure

    GilaMonster (12/24/2013)


    kapil_kk (12/24/2013)


    Should I drop unique constraint and make non clustered index only or add more column in unique constraint instead of creating another nonclustered index?

    If the index is there...

  • RE: Table Structure

    ALZDBA (12/24/2013)


    all NCI access that needs extra data will use the clustered index to fetch that data.

    what columns do you expect to get used ?

    Provide indexes for those columns and...

  • RE: Dynamic sql - how to return a value

    you can check for foreign key constraints using this query-

    UPDATE

    SET A.deleted = 1

    FROM tblParent A

    LEFT JOIN tblChild B ON A.PID = B.PID

    WHERE B.PID IS NULL

  • RE: Updating a Sequence Number with Order

    Can you please provide us some more information...

    Expected output from given input data?

Viewing 15 posts - 76 through 90 (of 1,047 total)