Forum Replies Created

Viewing 15 posts - 24,196 through 24,210 (of 26,486 total)

  • RE: Performance impact of using functions in a join

    This is how I would rewrite the query you originally posted:

    SELECT

    eventId

    ,startTime

    ...

  • RE: SQL Server Response times slow

    True, if running x64, you don't need the /3GB switch, but the OP didn't indicate what version they are running.

    We are running a mixed environment ourselves; SQL Server 2005 x32...

  • RE: varchar to datetime

    Madhivanan (9/24/2008)


    Lynn Pettis (9/24/2008)


    There is another side to this. If the date fields are currently varchar(8) with the dates formatted yyyymmdd, what effect will changing the data type to...

  • RE: SQL Server Response times slow

    Glen (9/24/2008)


    Suggestion: upgrade the RAM to 4 GB. Cheap and effective.

    Agree with the above, but be sure to add the /3GB switch to the boot.ini file or the extra memory...

  • RE: query - dates

    Adrian Nichols (9/24/2008)


    I need a sample query to only lift record 2 and 4 as the others are not year long policies.

    Lynn,

    I believe that the records, 2 and 4, correspond...

  • RE: varchar to datetime

    There is another side to this. If the date fields are currently varchar(8) with the dates formatted yyyymmdd, what effect will changing the data type to datetime have on...

  • RE: query - dates

    I'm getting confused. The original post asked to find records for year-long policies, yet the post with sample data seemed to be asking to find the policies that AREN'T...

  • RE: Rewrite an IF statement

    Looks good to me.

    😎

  • RE: Find a change in address in a result set

    create table #TestTab (

    RowNum int,

    AddressIdent int,

    Address1 varchar(50),

    DateChanged datetime);

    insert into #TestTab (RowNum, AddressIdent, Address1, DateChanged)

    select...

  • RE: Find a change in address in a result set

    Here is another way to skin a cat. I'm sure some of the gurus out there may come back and say this is still rebar, but it eliminates a...

  • RE: query - dates

    Actually, what I think is that the OP needs to post additional information, including sample data and expected results. This would greatly assist in determining a solution.

    😎

  • RE: Find a change in address in a result set

    bcronce (9/23/2008)


    1,1,1234 park st,1-1-2000

    2,1,1234 park st,1-2-2000

    3,1,1234 park st,1-3-2000

    4,1,2345 park ave,1-4-2000

    5,1,1234 park st,1-5-2000

    6,1,1234 park st,1-6-2000

    The correct result should be 5.

    originally my set based logic would return the correct result for anything...

  • RE: query - dates

    ZenDada (9/23/2008)


    or using the year part,

    where datediff(year,startdate,dateadd(d,1,enddate))>=1

    or datediff(year,startdate, enddate)>=1

    depending on which one actually meets your definition

    This won't work if partial years span years. Example, datediff(yy,'2008-10-01','2009-01-31) = 1.

    😎

  • RE: Find a change in address in a result set

    bcronce (9/23/2008)


    When i tried to solve this based on just a table with (rownumber, addressident, vchaddress, datechanged), I ran into grouping problems. I could try to find the max rownumber...

  • RE: query - dates

    vyas (9/23/2008)


    select datediff(dd,sdate,edate)from table where datediff(dd,sdate,edate) =365

    where sdate is startdate and edate date enddate

    The above is not quite right. If you do the following:

    select datediff(dd,'2008-01-01','2008-12-31')

    the result is:

    365

    If...

Viewing 15 posts - 24,196 through 24,210 (of 26,486 total)