Re: Dates where day/month is unknown

From: Michael Nolan <nolan_at_helios.unl.edu>
Date: 30 Aug 1993 16:58:31 GMT
Message-ID: <25tbjn$6cn_at_crcnis1.unl.edu>


deacon_at_inf.ethz.ch (Andrew Deacon) writes:

>However, I cannot retrieve the dates without knowing the format
>in which they were inserted. For example, if just the year was
>inserted (e.g., 1984) and I retrieve the date - I get 01 Aug 1984
>(which is plain not true).

By chance did you do the insert on August 1st of this year?

>Is there a simple solution to this problem? I just want to get
>back the information I inserted - nothing more!

I don't think the internal format use by Oracle to store dates lends itself to 'null' months or days.

The simplest solution is probably NOT to use the 'date' format. Store the year-only data as a CHAR(4) or NUMBER, and I'm not sure what the 'best' way to store the mm-yy data is. Kind of depends on how you want to use it afterwards.

An alternative would be to force a day of '01' and a month and day of 01-JAN' for those dates.

---
Michael Nolan, Sysop for the DBMS RoundTable on GEnie
nolan_at_notes.tssi.com, dbms_at_genie.geis.com
(posted from nolan_at_helios.unl.edu)
Received on Mon Aug 30 1993 - 18:58:31 CEST

Original text of this message