Re: Input Mask on Date for Year or Month Only
- From: B J <BJ@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 21 May 2008 18:28:32 -0700
Yes, thank you - I needed to clarify what I needed. Upon further thought, a
single column for Year/Month is all I really need.
I know there will have to be a value in "Day", but that's irrelevant to me,
as would the decimal places for "Time".
I can have the user enter it as either "August, 2008", or "08/2008", then,
which is largely what I was driving at.
How do you change the default display, then? Can I change it to a custom
"yyyy-mm" format?
"fredg" wrote:
On Tue, 20 May 2008 15:36:01 -0700, B J wrote:.
I want to have either a single classification for Year-Month, or a field for
year, and a field for Month.
I'd like to be able to use the Date/Time functions to compare these to other
data.
Can I use an input mask to caputre only the year or only the month?
Specifically for the month, I'd like the user to be able to enter "August"
or "08" into the field - not sure how to do this if I used "Integer" or
"Text" as the field type.
If anyone has some thoughts on this, they'd be much appreciated.
Thanks;
Ben.
Why??????
If you wish to use the DateTime functions, then the field's datatype
should be DateTime.
A DateTime datatype value must be a valid date, which includes the
Month, Day, and Year, so while you can DISPLAY a date in month/year
format, the stored value must contain the day as well.
What you can do is have the user enter the date value in mm/yyyy or
mm-yyyy format, i.e. 08/2008 or 08-2008. Access will then interpret
and store that value as 08/1/2008. Do not use an Input Mask. Set the
Format property of the control to mm/yyyy or mm-yyyy. You will be able
to use any of the Access Date functions.
Other than that, you could create a Text datatype field, enter the
"08/2008" or "08-2008" as text. But then you will no longer be able to
use any of the date functions without first converting the text back
into a valid Datetime value which means giving it a day value.
The same holds true if you used separate month and year fields.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
- Follow-Ups:
- Re: Input Mask on Date for Year or Month Only
- From: fredg
- Re: Input Mask on Date for Year or Month Only
- References:
- Input Mask on Date for Year or Month Only
- From: B J
- Re: Input Mask on Date for Year or Month Only
- From: fredg
- Input Mask on Date for Year or Month Only
- Prev by Date: Fields in 2 Tables
- Next by Date: RE: Fields in 2 Tables
- Previous by thread: Re: Input Mask on Date for Year or Month Only
- Next by thread: Re: Input Mask on Date for Year or Month Only
- Index(es):
Relevant Pages
|
|