Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: modeling year and month for summary data

RE: modeling year and month for summary data

From: Jacques Kilchoer <Jacques.Kilchoer_at_quest.com>
Date: Fri, 14 Nov 2003 16:09:25 -0800
Message-ID: <F001.005D6B36.20031114160925@fatcity.com>


> -----Original Message-----
> Steiner, Randy
>
> I have a table that will contain sales monthly summary. I am
> not sure which
> is the better way to handle the date of the data. I can
> create a year field
> and a month field or I can create a date field and force in
> the day e.g.
> 2003 November's data can be 01-Nov-03 .
>
> Is there a censuses on which way to handle the date?

A consensus? I think probably not. :)
I like the idea that the date datatype performs validation on the values entered. I personally would create a date field with a before insert/update trigger that sets :new.date := trunc (:new.date, 'MM') ;
If you need an index on year then you can use a function based index on trunc (date, 'YYYY')

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jacques Kilchoer
  INET: Jacques.Kilchoer_at_quest.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Fri Nov 14 2003 - 18:09:25 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US