Forum Replies Created

Viewing 15 posts - 1,066 through 1,080 (of 2,894 total)

  • RE: using dateadd function

    Henrico Bekker (10/15/2012)


    select criteria from yourtable where datecolumn < dateadd(dd, 30, '20110420')

    What do you mean by "within"?

    Is it within 30 days before the day?

    WHERE datecolumn BETWEEN '20110420' AND...

  • RE: Query Help

    I'm a bit confused with OP last requirements. Looks like expected outcome doesn't corresponds to:

    That means we need to display first Enrollment date for first test date for particular Year.

    May...

  • RE: Query Help

    That may win a bit:

    SELECT td.dtStartDate

    ,Max(dtRunDate)

    FROM #TestDates td

    LEFT JOIN #EnrollmentDates ed

    ON ed.dtRunDate <= td.dtStartDate

    group by td.dtStartDate

  • RE: Function or Join

    Dhirju (10/11/2012)


    which is better for performance wise,

    function or join?

    thanks

    What is the healthier Apples or Oranges? 😉

  • RE: Update a Record Using a Trigger with SELECT Statement

    Your trigger has one major flow.

    When INSERT operation is performed the TRIGGER is fired for an operation, not for every inserted record.

    The way your trigger is written it will...

  • RE: Appropriate Data Type

    Float is a very bad choice for monetary values as it's approximate numeric.

    I would recommend Decimal which is precise (exact numeric).

    You can use Money too, if you brave enough, but...

  • RE: Using IF condition on Cursor

    ...

    The purpose for using a Cursor is because i need to run an Update not for one "referencia" = Article, but for more and less 170000...

    That your line is the...

  • RE: Using IF condition on Cursor

    Sorry mate, it's 20 past midnight in my place. You will need to wait for someone in US to pick up this thread.

    I can give you some ideas how...

  • RE: Using IF condition on Cursor

    First of all, your current code in your cursor has some bugs:

    -you never set @tam-2 variable,

    -if no records found in SGT table, @tam-2 will be NULL and your...

  • RE: #Table

    Arthur Kirchner (10/9/2012)


    Just FMI:

    has anyone of you ever used global temp tables?

    I definitely didn't^^

    I did.

    Great tool for some one-off & ad hoc tasks.

    But also, can be used in more advanced...

  • RE: what is the difference between ODBC and OleDB?

    Phil Parkin (10/9/2012)


    Steve Jones - SSC Editor (7/28/2008)


    Good explanation. OLEDB is newer and superceeds ODBC. You should aim to use OLEDB connections where possible. I believe there's an OLEDB provider...

  • RE: INSERTING VALUES BASED ON DISTINCT FIELDS

    Or with using DISTINCT instead of GROUP BY:

    INSERT INTO #Sampledata (USERID, CLIENTID, PROJECTID)

    SELECT DISTINCT 'YYY', CLIENTID, PROJECTID

    FROM #Sampledata

    Actually your data model doesn't look right.

    If for every user, you...

  • RE: #Table

    Jason-299789 (10/9/2012)


    Fair enough Eugine, I agree its an important caveat but does that mean unless you keep an open transaction on the table it will disappear once the transaction is...

  • RE: #Table

    Jason-299789 (10/9/2012)


    yuvipoy (10/9/2012)


    # is a Local temporary tables

    ## is a Global temporary tables

    Local Temp table is valid only for that processor id(@@SPID) alone where as Global Temp table is valid...

  • RE: Searching By UniqueIdentifier

    Try:

    Select *

    From dbo.Events

    Where EventID = '{31AB0164-6BC9-448D-BC3E-53FEA210365E}'

Viewing 15 posts - 1,066 through 1,080 (of 2,894 total)