Results 1 to 4 of 4

Thread: Interval Type

  1. #1
    Join Date
    Dec 2011
    Posts
    8

    Unanswered: Interval Type

    Has anyone tried to implement a time interval type in the form of a user defined type in SS2k8r2? Specicifically an interval type described in the book Temporal Data and the Relational Model by C. J. Date et al.

    As an example, an interval is below:

    1/4/2006:1/10/2006

    which would mean the time period from 1/4 to 1/10.

  2. #2
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4

    Lightbulb

    After having tried to use UDF's, I never use them again. I even stopped attempting to do so.

    I would create two DATE columns, a FromDate and a TillDate to model a time interval. But then again, I am not C.J. Date. I could do whatever I wanted to do with them, and it would work and keep on working, but it is not a UDF, and as a consequence, a bad and retarded way to do things.
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

  3. #3
    Join Date
    Dec 2011
    Posts
    8

    User Defined Type

    Wim discussed a User Defined Function, not a User Defined Type, which is quite different from what I am trying to do.

    Implementing an interval type would drastically change the BI landscape. You wouldn't have to create a "cube" and create the messy SQL extension to handle it.

  4. #4
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    Wim discussed a User Defined Function, not a User Defined Type, which is quite different from what I am trying to do.
    I'm sorry. I made a typo. There is nothing wrong with using User Defined Functions (UDF), I was definitely talking about User Defined Types (UDT). Perhaps there is a way to work efficiently with UDT's, but I haven't found it.

    Let me correct my previous post:
    After having tried to use UDT's, I never use them again. I even stopped attempting to do so.

    I would create two DATE columns, a FromDate and a TillDate to model a time interval. But then again, I am not C.J. Date. I could do whatever I wanted to do with them, and it would work and keep on working, but it is not a UDT, and as a consequence, a bad and retarded way to do things.
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •