Forum Replies Created

Viewing 15 posts - 211 through 225 (of 355 total)

  • RE: How to make range for date and count?

    OK - if you are happy to ignore any time zone offsets and variations in time zone offset between different rows, and assuming that the date/time strings stored in your...

  • RE: Again recursive problem

    I think the trick here is to start at the bottom (parts that don't have subcomponents) and work up.

    WARNING: I haven't got access to SS2K5 right now so code below...

  • RE: How to make range for date and count?

    When I said local time, I meant the local time whereever the source data was generated, not where the SQL Server is located.

    For your reporting, do you need the date/times...

  • RE: How to make range for date and count?

    SQL Server won't be able to implicitly convert the varchar strings like the following to the datetime data type.

    '2009-01-27T14:32:37.7389657-08:00'

    Having a mixture of different formats is one of the problems you...

  • RE: How to make range for date and count?

    Are all your date/times being stored as varchars in the following format?

    yyyy-MM-ddTHH:mm:ss

    e.g.

    2008-09-01T09:00:01

    If so, this is a standard (ISO 8601) format that should be reliably converted to a datetime whatever the...

  • RE: Selecting Only Certain Rows In A Group

    Does this query do what you need?

    It will only update rows for those shipments where the Drop_Or_Live column values are all 'DROP'.

    CREATE TABLE #DropShipment (

    Shipment int NOT NULL,

    Stop int NOT...

  • RE: Convert DateDiff into Hours, Minutes, Seconds, Milliseconds

    This will return the time difference including milliseconds. It will work fine if the time difference is guaranteed to be less than 24 hours.

    However, if the time difference is greater...

  • RE: Concatenating String and HEX value into Binary field

    The method I've used to construct the binary(20) key is as follows:

    @UniqueID and @Group are apparently both hexadecimal strings. These are concatenated together and the concatenated hexadecimal string is then...

  • RE: Recursive Problem at WHILE Statement

    Are you sure?

    My query is including results from 3 levels of the hierarchy.

    I also worked out the results by hand and got the same results as the query.

  • RE: Recursive Problem at WHILE Statement

    Thanks for providing the sample data and table structure.

    Does this query give you the results you need?

    ;WITH cteSammel AS (

    SELECT

    1 AS [Level],

    P.ProductID AS pid,

    S.SalesPeriod AS sp,

    S.Quantity...

  • RE: Recursive Problem at WHILE Statement

    One option would be to use a recursive CTE to recurse through the hierarchy. Lookup SQL Server Bookes Online for an example. If you used this method you could eliminate...

  • RE: Recursive Problem at WHILE Statement

    Books Online says this about CTEs:

    Specifies a temporary named result set, known as a common table expression (CTE). This is derived from a simple query and defined within the execution...

  • RE: Loop Insert

    No need to loop.

    This statement will insert all 89 rows in one transaction.

    INSERT INTO [Registration]

    ([ContactID]

    ...

  • RE: T-Sql rant

    Why couldn't they write t-sql more like C#

    With the introduction of the LINQ language extensions to C# 3.0, you could argue that C# is borrowing some of the syntax of...

  • RE: T-Sql rant

    If cursors were more convenient to use, you'd have people trying to use them even more than they currently do and destroying the performance of even more database servers.

Viewing 15 posts - 211 through 225 (of 355 total)