Forum Replies Created

Viewing 15 posts - 3,826 through 3,840 (of 5,504 total)

  • RE: Overlapping Date Ranges with Gaps Possible

    Here's another version.

    Side note: instead of expanding it to 24hrs per day I just used the hours between noon and 10pm. If you need all 24hrs, you'd need to change...

  • RE: Overlapping Date Ranges with Gaps Possible

    Your reply doesn't really answer the question on how to actually calculate the working hours.

    Your sample data do make room for some interpretation... Also, your desired result is an integer...

  • RE: query help - is there a good solution to this?

    Please provide table definition, sample data and expected result in a ready to use format as described in the first link in my signature.

    That would make it easier for us...

  • RE: Overlapping Date Ranges with Gaps Possible

    I would use a calendar table (holding the day values), expand it to cover 24hrs per day (or the possible working hours) and join that to the ShiftData table.

    Something like...

  • RE: Help with XML

    Please provide table def and sample data that correspond to your expected result in a ready to use format as described in the first link in my signature.

  • RE: Importing XML data contained in a table's column to another table

    Glad I could help! 😀

  • RE: Collation Conflict

    I'm not sure if it helps but you could try to enforce a specific collation within the CASE statement:

    SELECT

    CASE

    ...

  • RE: Splitting a single row into 2

    Please provide some more information.

    What would be great would be some sort of ready to use sample data as described in the first link in my signature.

    In your case it...

  • RE: IN function

    You would need to use dynamic SQL for that:

    Here's an example:

    DECLARE

    @list VARCHAR(30),

    @SQLString NVARCHAR(200)

    SET @list ='''Bothell'',''Portland'''

    SET @SQLString = N'SELECT * FROM Person.Address WHERE city in('+@list+')'

    EXEC sp_executesql @SQLString

  • RE: Are the posted questions getting worse?

    I just have a headline for SSC jumping into my mind:

    Having trouble with your database or your kids?

    Have a look at SSC! We'll tune both! 😀 :hehe: 😀

  • RE: Are the posted questions getting worse?

    CirquedeSQLeil (4/7/2010)


    ...

    Funny - exercising restraint to not use a 1-liner on that.

    Brave man. Do you want us to consider it some kind of self-flagellation? 😀

  • RE: Are the posted questions getting worse?

    Grant Fritchey (4/7/2010)


    You kids take this outside or I'm going to get my belt!

    If there's any masochist involved you just called to continue :w00t:

    Side note:

    @jason: no matter how long your...

  • RE: Have some question

    GregoryF (4/7/2010)


    I think you have gone way beyond the scope of someone who asked what the difference between delete and truncate is 🙂 Don't confuse them while they are...

  • RE: delete repeating rows

    You might want to look into ROW_NUMBER together with CTEs. There are several solutions available on this site. Please search for "duplicate rows" in the scripts section.

  • RE: Recursive cross join to get all available combinaisons

    Do you know the max number of cross joins ahead of time?

    What I'd probably do in this case is to build a static table like the one I posted covering...

Viewing 15 posts - 3,826 through 3,840 (of 5,504 total)