Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / January 2005

Tip: Looking for answers? Try searching our database.

Inputting a date as Month - Year?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Simon Webb - 30 Jan 2005 08:39 GMT
Is there any way a date field can be formatted so that the operator only has
to enter month / year? (with preferably the day defaulting to the first day
of the month)?

I want to do in in such a way that the date format will be based on the PC
settings.

thanks in advance

Simon Webb
Ken Snell [MVP] - 30 Jan 2005 13:44 GMT
No, but you could store the month and year in two fields, and then use an
expression to display the information on a form or report...no need to store
a day if it's always going to be the first day.

To display the date for the first day of a month/year combination:

DateSerial([YearField], [MonthField], 1)

Signature

       Ken Snell
<MS ACCESS MVP>

> Is there any way a date field can be formatted so that the operator only
> has to enter month / year? (with preferably the day defaulting to the
[quoted text clipped - 6 lines]
>
> Simon Webb
MacDermott - 30 Jan 2005 21:45 GMT
I think if you format your field as m/yyyy you'll get the effect you want.

> Is there any way a date field can be formatted so that the operator only has
> to enter month / year? (with preferably the day defaulting to the first day
[quoted text clipped - 6 lines]
>
> Simon Webb
Ken Snell [MVP] - 30 Jan 2005 21:54 GMT
As long as the user enters a full, 4-digit year, yes, this should work.

Signature

       Ken Snell
<MS ACCESS MVP>

>I think if you format your field as m/yyyy you'll get the effect you want.
>
[quoted text clipped - 11 lines]
>>
>> Simon Webb
MacDermott - 31 Jan 2005 00:55 GMT
What problem would you forsee if the user entered a month/2-digit year?
Wouldn't this be interpreted, as requested by the OP, according to the PC's
settings?

> As long as the user enters a full, 4-digit year, yes, this should work.
>
[quoted text clipped - 13 lines]
> >>
> >> Simon Webb
Ken Snell [MVP] - 31 Jan 2005 01:14 GMT
No, not per my testing. If for example, you enter
   4/02

the value stored in the table is actually April 2, 2005 (for my US system).

If you enter 3/98, the value stored is March 1, 1998; I assume the
difference is because ACCESS knows that no month has 98 days.

The confusion appears to result if the "second" number is 31 or less,
obviously depending upon the month number for the "first" number

Signature

       Ken Snell
<MS ACCESS MVP>

> What problem would you forsee if the user entered a month/2-digit year?
> Wouldn't this be interpreted, as requested by the OP, according to the
[quoted text clipped - 22 lines]
>> >>
>> >> Simon Webb
MacDermott - 31 Jan 2005 12:02 GMT
I stand corrected.  Apparently I hadn't tested enough.

> No, not per my testing. If for example, you enter
>     4/02
[quoted text clipped - 33 lines]
> >> >>
> >> >> Simon Webb
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.