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 / Modules / DAO / VBA / July 2005

Tip: Looking for answers? Try searching our database.

Creating a custom date field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vikas Arya - 28 Jul 2005 22:00 GMT
I would like for a date field in my table to store only the current month and
year. This field would be my 'Due_Date'. The idea is that I could compare the
same set of records across my due date another field called, 'Recieved_Date.'
I will need to display all the records for which the 'Recieved_Date' is
either null or greater than the 'Due_Date'. But I am not sure how to create
the custom field to only show a date and year. Thanks for your help.
Signature

Thanks,

Vikas Arya

Rick Brandt - 29 Jul 2005 00:29 GMT
> I would like for a date field in my table to store only the current
> month and year. This field would be my 'Due_Date'. The idea is that I
[quoted text clipped - 3 lines]
> 'Due_Date'. But I am not sure how to create the custom field to only
> show a date and year. Thanks for your help.

Just store the first of every month and use formatting to suppress the display
of the day.  An Access DateTime can ONLY hold a complete date including year,
month, day, hour, minute, and second.  When you don't see a date it is actually
12/30/1899 under the covers and when you don't see a time it is actually
midnight.

You could fudge around with a text field or two separate fields, but then doing
comparisons and range testing is a LOT more complicated and/or inefficient.

Signature

I don't check the Email account attached
to this message.     Send instead to...
RBrandt    at       Hunter      dot      com

Tim Ferguson - 29 Jul 2005 18:00 GMT
> You could fudge around with a text field or two separate fields, but
> then doing comparisons and range testing is a LOT more complicated
> and/or inefficient.

I would argue that storing data that don't actually correspond with real
life is the fudge.

In addition, the users will notice a problem when they enter "12/04" and
discover they are now in April 2005, not December 20004.

For myself I would definitely recommend one of the other solutions.

Best wishes

Tim F
 
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.