Forum Replies Created

Viewing 15 posts - 1,066 through 1,080 (of 3,544 total)

  • RE: Are the posted questions getting worse?

    jcrawf02 (5/26/2011)


    Actually, your English is better than most of the English-speaking folks, myself included. I should try responding in Italian...

    Io non sarei schizzando senza senso

    😀

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: To increase value from Engg0 to Engg1, Engg2, and so On!!!

    btw this will only allow 99 occurrances

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: To increase value from Engg0 to Engg1, Engg2, and so On!!!

    Use a trigger like this

    CREATE TRIGGER trg_test ON [Test] FOR INSERT AS

    UPDATE t

    SET t.eng_ref=t.eng_ref+RIGHT('0'+CAST(t.test_id as varchar),2)

    FROM [Test] t

    JOIN inserted i ON i.test_id=t.test_id

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: To increase value from Engg0 to Engg1, Engg2, and so On!!!

    Gopal Singh (5/26/2011)


    Hello ,

    I have create table Test table with primary key id test_Id and auto increment when inserting a record in a table, then i add another field with...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: To increase value from Engg0 to Engg1, Engg2, and so On!!!

    LEFT(RefNo,PATINDEX('%[0-9]%',RefNo)-1)+

    CAST(CAST(SUBSTRING(RefNo,PATINDEX('%[0-9]%',RefNo),255) as int)+1 as varchar)

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: How to join 2 tables considering record sequence order?

    SELECT a.NUMBER, a.[TYPE], a.DATESTAMP, b.ASSIGNMENT

    FROM (SELECT ROW_NUMBER() OVER (PARTITION BY act.NUMBER ORDER BY act.THENUMBER ASC) AS [RowNum],

    act.THENUMBER, act.NUMBER, act.[TYPE], act.DATESTAMP

    FROM #tbl_ACTIVITY act WHERE act.[TYPE] <> 'Notification') a

    JOIN...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: parse string

    calvo (5/19/2011)


    I like the patindex idea, I'll have to keep that one in the ol' toolbox.

    Here's what I came up with

    declare @x varchar(50) = 'Jane Smith 05 18 2011 mamm.pdf'

    select...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: parse string

    Providing that the month is the first 2 digits and the date is 10 chars long then this should work

    ISDATE(REPLACE(SUBSTRING([column],PATINDEX('%[0-9][0-9]%',@x),10),' ','/'))

    and

    CAST(REPLACE(SUBSTRING([column],PATINDEX('%[0-9][0-9]%',@x),10),' ','/') as datetime)

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Select rows from table that don exist in another with where clause

    WITH cte (PeriodID,StaffInitials)

    AS (

    SELECT p.PeriodID,s.StaffInitials

    FROM (SELECT DISTINCT t.DayId,t.PeriodID FROM tTimeTable t WHERE t.DayID = 1) p

    CROSS JOIN tStaffTimeTableInfo s

    WHERE NOT EXISTS(SELECT * FROM tTimeTable t...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Select rows from table that don exist in another with where clause

    I think this will work but there must be a better way, just cannot think of it at the moment.

    WITH p (DayId,PeriodID)

    AS (SELECT DISTINCT t.DayId,t.PeriodID

    FROM tTimeTable t

    WHERE...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Primary Key Violation Frustration

    p.s. I normally run the SELECT without the INSERT and analyse the output for duplicates and start backwards from there.

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Primary Key Violation Frustration

    Ninja's_RGR'us (5/17/2011)


    Checked the inner join to make sure they don't double the keys somehow??

    What Ninja's stated is most likely the cause.

    Most of PK violations I come across are due to...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Today's Random Word!

    Ray K (5/13/2011)


    Brandie Tarvin (5/13/2011)


    WOTD:

    :w00t: :hehe: :crazy:

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: calculating time from string

    Or without the cte

    SELECT

    CAST(LEFT([Data Team],2) as int)+CAST(LEFT([CRM],2) as int)+CAST(LEFT([IM Team],2) as int)

    +(CAST(RIGHT([Data Team],2) as int)+CAST(RIGHT([CRM],2) as int)+CAST(RIGHT([IM Team],2) as int))/60 AS [HH],

    (CAST(RIGHT([Data Team],2) as int)+CAST(RIGHT([CRM],2) as int)+CAST(RIGHT([IM...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Today's Random Word!

    pee - the dog last night and none on the roofs here. A lot in the grass.

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 15 posts - 1,066 through 1,080 (of 3,544 total)