PC Review


Reply
Thread Tools Rate Thread

Date field format

 
 
Tom
Guest
Posts: n/a
 
      1st Dec 2009
The date field appears to require the day, month, and year. I'm setting up a
catalogue of items where there is an "acquired date" field. Some items have
day, month, year and some items have month, year and some items have year
acquired only. Is there a way to keep it as a date field but only enter part
of the known dates? If not, then I assume it has to change to a text field.
If that is the case is there a "better" way to enter the dates so that if
needed, it could be queried or sorted as a date field? Examples coming to
mind:
year-month-day: 2009-12-01
year-month (no day): 2009-11-00
year only 2009-00-00

Thanks!
 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      1st Dec 2009
There's no way to use a date field unless you give it an entire date. That's
because under the covers, the date is stored as an eight-byte floating point
number where the integer portion represents the date as the number of days
relative to 30 Dec, 1899, and the decimal portion represents the time as a
fraction of a day.

You'll either have to use default month and/or day if you don't know it, or
use a text field.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Tom" <(E-Mail Removed)> wrote in message
news:76E52487-205A-4BCE-84D7-(E-Mail Removed)...
> The date field appears to require the day, month, and year. I'm setting
> up a
> catalogue of items where there is an "acquired date" field. Some items
> have
> day, month, year and some items have month, year and some items have year
> acquired only. Is there a way to keep it as a date field but only enter
> part
> of the known dates? If not, then I assume it has to change to a text
> field.
> If that is the case is there a "better" way to enter the dates so that if
> needed, it could be queried or sorted as a date field? Examples coming to
> mind:
> year-month-day: 2009-12-01
> year-month (no day): 2009-11-00
> year only 2009-00-00
>
> Thanks!



 
Reply With Quote
 
Jerry Whittle
Guest
Posts: n/a
 
      1st Dec 2009
I'd prefer to keep it a date field and if the day and month isn't known, make
it 1/1/2009 for example. If the day isn't known, make it the first day of the
month. If the entire date isn't known, leave it null.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Tom" wrote:

> The date field appears to require the day, month, and year. I'm setting up a
> catalogue of items where there is an "acquired date" field. Some items have
> day, month, year and some items have month, year and some items have year
> acquired only. Is there a way to keep it as a date field but only enter part
> of the known dates? If not, then I assume it has to change to a text field.
> If that is the case is there a "better" way to enter the dates so that if
> needed, it could be queried or sorted as a date field? Examples coming to
> mind:
> year-month-day: 2009-12-01
> year-month (no day): 2009-11-00
> year only 2009-00-00
>
> Thanks!

 
Reply With Quote
 
John Spencer
Guest
Posts: n/a
 
      1st Dec 2009
You can use three Number fields to do this, but you will need to take care to
ensure valid entries.

TheYear
TheMonth
TheDay

Now you can combine those as needed to generate a full date.

Another option is to use a date field and always enter a full date and then
have an additional field named ApproximateDate and store Full, Year Only,
YearMonth Only or some other indicator. For Year only you would enter Jan 1
of July 1 in the date field (plus the year). For Year and month enter the
year and month and 15 for the day.

Other schemes are possible.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Douglas J. Steele wrote:
> There's no way to use a date field unless you give it an entire date. That's
> because under the covers, the date is stored as an eight-byte floating point
> number where the integer portion represents the date as the number of days
> relative to 30 Dec, 1899, and the decimal portion represents the time as a
> fraction of a day.
>
> You'll either have to use default month and/or day if you don't know it, or
> use a text field.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application.ExportXML exports dates in the wrong format or the 1899 date if date field is empty Jennifer Robertson Microsoft Access VBA Modules 4 2nd Apr 2009 02:57 AM
How can I format a date field to force a specific date format? =?Utf-8?B?c3BrZWxseQ==?= Microsoft Access 4 19th Dec 2004 05:37 PM
Export Outlook date field as date/time format to Access database =?Utf-8?B?QmVja3k=?= Microsoft Outlook Discussion 0 2nd Dec 2004 02:49 PM
Imported Date field will not FORMAT-CELLS as a DATE =?Utf-8?B?RSBM?= Microsoft Excel Misc 1 18th Nov 2004 10:36 PM
form field date format with default date Keith G Hicks Microsoft Word Document Management 1 15th Oct 2004 10:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:18 AM.