Dates

whitestone

Usually Confused
Local time
Today, 06:13
Joined
Oct 29, 2002
Messages
35
I have a couple of fields where I want to store dates.

I want the user to be able to enter 98 (for example) and have Access automatically enter 1998.

Any way?
 
Are you using a Date/Time field?

I'm not sure what you're asking, unless you mean that you're trying to store JUST the year in a numerical field; that's probably why you're running into difficulties.

Can you be more concrete/specific with your fields? If you're trying to separate out Month/Day/Year in special fields for later manipulation, you may have better success with entering them as a real Date/Time field and splitting them later in queries/reports/etc.

Good luck,
David R
 
I forgot about this thread but thought I would come back to it.

I am still looking for a way to store just the year in a field....

I basically have a field containing the Year in which someone died and need the user to be able to enter 98 and it automatically update to 1998, 84-1984 etc etc....
 
Don't know if this will do it, but...

You should be able to make a combobox that has the available 'years' in it as a visible value, i.e. 84, 85, 86, etc.. and then have it store the four-digit value...

It would look something like this (unaffected properties have not been changed):
Code:
[B]Format[/B] 
ComboYearDied:
ColumnCount: 2
Column Widths: 0";0.5"
List Width: 0.5"

[B]Data[/B] 
Control Source: <field where you'll store the 1984>
Row Source Type: Table/Query
Row Source: tableYears
Bound Column: 1
Limit to List: Yes
Auto Expand: Yes

and then make a tableYears, with two columns: The first, the Primary Key, should be the FULL four digit year (as a number or as a Date 1/1/XXXX). The second column should be what you want them to type in, for example 84, 03, etc. This is a text field, not a numeric field. Fill this with all the years you'll possibly ever need.

However I think you may be missing the obvious: if Access sees a date like 1/1/98, it will automatically know the Year() portion is 1998, no conversions or updates to data tables ever necessary.

Good luck,
David R
 
Last edited:

Users who are viewing this thread

Back
Top Bottom