Forum Replies Created

Viewing 15 posts - 76 through 90 (of 196 total)

  • RE: query help required

    OK - glad I could help.

  • RE: query help required

    Paarthasarathy (2/10/2010)


    Hi Wschampler

    but the query does not work for this sample data..

    insert into emp values(1,'CCCCC',10000,'abc','01/01/2005','n')

    insert into emp values(1,'CCCCC',10000,'xys','01/11/2005','n')

    insert into emp values(1,'CCCCC',20000,'xyz','01/01/2006','n')

    insert into emp values(1,'CCCCC',20000,'xyy','01/01/2008','y')

    i need this employee to get returned...

  • RE: query help required

    @Paarthasarathy: can it be there is an error in your sample data? The employees with ename AAAAA and BBBBB both have eid 1.

    To test my solution, I changed the...

  • RE: query help required

    Maybe I'm missing something but could it be as simple as this?

    SELECT *

    FROM emp

    WHERE act = 'y'

    ...

  • RE: Add One Day to a Date

    Try this

    DECLARE @TodaysDate Date

    DECLARE @TomorrowsDate Date

    SET @TodaysDate = '20100214'

    SET @TomorrowsDate = DATEADD(dd,1,@TodaysDate)

  • RE: Converting Hijri Date

    Adi Cohn-120898 (2/10/2010)


    Lynn Pettis (2/10/2010)


    I ran the following: select convert(datetime, '8/12/1430' , 131) and it returned 2009-11-25 00:00:00.000. Is that correct?

    Unfortunately I have to admit that I was wrong....

  • RE: Tsql conditional Join

    PH,

    You're welcome and thank you for your feedback.

    I do recommend you reconsidering the design of your datamodel... If you explain why you think you need this construction, we may help...

  • RE: Avoiding a cursor when copying a master-detail structure

    Grant Fritchey (2/10/2010)


    wschampheleer (2/10/2010)


    pink_panther,

    Thank you for the compliment.

    Unfortunately, I believe your new version is no improvement: you still need to insert the old ID if you want to retrieve it...

  • RE: Avoiding a cursor when copying a master-detail structure

    pink_panther,

    Thank you for the compliment.

    Unfortunately, I believe your new version is no improvement: you still need to insert the old ID if you want to retrieve it using the OUTPUT...

  • RE: Converting Hijri Date

    What version of SQL Server are you using?

    In SQL 2008 you have a date data type with a range of 0001-01-01 through 9999-12-31 (January 1, 1 A.D. through December 31,...

  • RE: Avoiding a cursor when copying a master-detail structure

    if you go for the above solution, you'll need to do some extra work afterwards. Here's why.

  • RE: trigger modified date

    Don't have access to SQL2K anymore 🙂 but try the view sys.triggers and look for the column modify_date.

  • RE: Tsql conditional Join

    You'll probably get some remarks on the quality of this design, but I'll skip that and just try to answer your question.

    You could do something like this

    SELECT * --...

  • RE: view very slow in sql2005

    First thing to check is whether the statistics are updated on your SQL Server 2005 machine.

    If they are OK, you should compare the execution plans on both servers (if you...

  • RE: SQL Query Column Dynamic Alias Name Issue

    You could rewrite your query to return 1 row per year (instead of different columns) with one column that holds the year and one that holds the value.

    e.g.

    col1 col2 col3...

Viewing 15 posts - 76 through 90 (of 196 total)