Forum Replies Created

Viewing 15 posts - 14,221 through 14,235 (of 14,953 total)

  • RE: total time difference between more than two dates

    Well, since dates are stored as floating point numbers, it can have those problems, but there isn't a way around that if you're using datetime data. And it should...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Is there a better approach?

    ALZ, why do it as a separate table? Two parents, yes. But why a separate table?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: total time diff between more than two dates

    This is a duplicate post. There's more data in the one that was posted in SQL Server Compact Edition. (In the future, please don't post twice.)

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Sort question with a date

    A datetime dimensions table would definitely be the way to go.

    Create a table with half-hour increments of dates and times. Should have a "begin" column and an "end" column....

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Not sure how to approach this.

    Would a cross-join between customers and skills, and a left join to the map table, with a null select in the Where for the map table, work?

    Something like:

    select Customer, Skill

    from...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Deadlocks on a simple select statement

    Turn on a deadlock trace (Books Online has details), and you'll find out exactly what's causing it.

    Most likely, some other process is trying to update the same information you're trying...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Bloated

    I'm on the side of thinking that keeping business-relevant data, even stuff that was relevant once but may no longer be so, is more important than the minor costs of...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: total time difference between more than two dates

    Jeff, good article. Just to add to it, you can do this:

    declare @D1 datetime, @D2 datetime

    select @d1 = '02/Nov/06 9:14:21 AM', @d2 = '19/Apr/07 11:52:31 AM'

    select datepart(year, @d2-@d1)-1900 as...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: sql memory usage

    I'm having trouble following your question.

    Are you asking if you can make the database faster by making more of it stay on the disk instead of in memory? That...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: total time diff between more than two dates

    "datediff(hour, date1, date2)" will give you the hours.

    "datediff(minute, date1, date2)" will give you the minutes, but you need to use "datediff(minute, date1, date2)%60" to get the minutes left over after...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: LONG TEXT need to be able to view, edit and update data

    You seem to have posted this in the wrong forum. This is for SQL 2005.

    Regardless, there's no way to "edit" text data through Query Analyzer, so far as I...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Subsitute of TO_CHAR in transact SQL???

    I agree with Jeff that SQL isn't the way to do this. Every front end app I've ever worked with will do this better.

    If, somehow, you absolutely must do...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Union/OR query

    The reason I think it's something other than the select statement causing this is because of what Books Online says about Select statements and Locks.

    Shared (S) locks allow concurrent transactions...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Can these 3 queries be combined to only use one query?

    I'm sure they can be combined, but I need to know more about what the desired end result of the query is. For one thing, it's not clear to...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Indexing Against "Optional" WHERE Conditions

    Now I know it's been a long week. Yeah, dynamic SQL will do that quite nicely.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 15 posts - 14,221 through 14,235 (of 14,953 total)