473,406 Members | 2,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How can I accept partial data for a date

emandel
65
I have a field in my "members" table that asks for birthday
I don't want it to be so rigid that it will only take full information or nothing. In other words how can I get it to accept only a year if that is all I have or only the month and day without the year. is this possible?
Dec 27 '06 #1
7 2990
missinglinq
3,532 Expert 2GB
The only way you can do this, I would think, would be to use a field of a text datatype, rather than a date datatype. You wouldn't be able to use any of Access' native date functions, but you couldn't use them anyway with only partial dates.
Dec 27 '06 #2
emandel
65
I am relying on access to use the data as a date so for example I need to know who is under 40 years old but the birthday per se is not so important.
Dec 27 '06 #3
missinglinq
3,532 Expert 2GB
Well, the simple fact is you can't tell how old someone is from the year of birth alone, you have to have the entire date!
Dec 27 '06 #4
emandel
65
Yes but I could know that he is older than someone else in the db. I could seperate the birth year from the month and day and have it in a seperate field. but could I get access to recognize either fields as a date?
Dec 28 '06 #5
Killer42
8,435 Expert 8TB
Yes but I could know that he is older than someone else in the db. I could seperate the birth year from the month and day and have it in a seperate field. but could I get access to recognize either fields as a date?
One thing you could do is to store it as a numeric field in the form yyyymmdd. Any unknown portion is set to zero. Thus, if you only had a year, say 1978, the value would be 19780000. This may not be much use as a date, but would certainly work for comparison purposes.

If you need to be able to use date processing, what about storing two values? One actual date (setting unknowns to 01, perhaps) to allow an approximate age to be calculated, and one "comparison date" as described above.

A coupe of examples:
A: The 1978-born person
Date for age calculation: 1st Jan, 1978
Number for comparison: 19780000

B: Someone whose full birth date is known
Date for age calculation: 20th May, 1952
Number for comparison: 19520520

You might get away with using a single date field, but would probably need some way to determine which parts were real data and which made up.
Dec 28 '06 #6
missinglinq
3,532 Expert 2GB
I don't want it to be so rigid that it will only take full information or nothing. In other words how can I get it (Access) to accept only a year if that is all I have or only the month and day without the year. is this possible?
I could seperate the birth year from the month and day and have it in a seperate field. but could I get access to recognize either fields as a date?
A DATE consists of a month, a day and a year. Neither Access nor any other computer language can recognize anything else as a date.

I am relying on access to use the data as a date so for example I need to know who is under 40 years old but the birthday per se is not so important.
The birthday is important! Without it you cannot tell if someone born in 1966 is 39 (born after 12/28) or 40 (born 12/28/66 or earlier.) You certainly can't tell how old someone is if all you have is a month and day!
Dec 28 '06 #7
NeoPa
32,556 Expert Mod 16PB
In answer to your original question :
You could store a text field allowing them to enter what they like. You would have to check that it resolves to a date of some form before updating.
FYI entering a string of 'March 1985' would be ok as it would convert happily to 1 March 1985.
You need to remember that any comparisons on non-whole dates are unreliable and approximate at best.
Dec 28 '06 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: astro | last post by:
Anyone have suggestions on where to troubleshoot this error? Background: -Access 2k v. 9.0.6926 sp3 - front and backend on production server (wiindows 2k) -accessed via Citrix -front-end is...
4
by: Jeff Smith | last post by:
Hi Is there a way to do partial replication of data? I'm looking at having a central back end data file which contains all the data from all users. But when each user synchronises the mobile...
10
by: ptass | last post by:
Hi In asp.net 2.0 an aspx files .cs file is a partial class and all works fine, however, I thought I’d be able to create another class file, call it a partial class and have that compile and...
2
by: Bob | last post by:
using "Imports System.Data.odbc", I'm using textbox "text" property to insert a new record into te dataset. If the date textbox is empty the dataset won't accept the value. How do I insert a null...
1
by: chungiemo | last post by:
Hi thought I would do another thread as this one is a bit different from the previous problem I am looking for a solution to the relating problem Comparing 2 access databases with 2 tables,...
1
by: hardieca | last post by:
Hi! I decorate my unfinished classes and methods with a custom TODO attribute (as in things To Do). Using reflection, I am then able to parse through my classes and output all TODOs to a list I...
3
by: YSpa | last post by:
Hi, I'm using SQL-Server Express 2005 on Windows XP Prof. and after working properly for some time my asp.net application suddenly gave the error that my DateFormat wasn't accepted while using...
2
by: Peted | last post by:
Hi, im moving a project from vs2005 to vs 2008. is doing so i have come across a compiler error regarding partial classes that i dont understand if anyone can explain it to me please the...
10
by: sparks | last post by:
We are entering mm/dd/yyyy but some of the date fields only contain years. Can a date be made to only take a year entry if that is all that they have? can it be made to take only 2008 or maybe...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.