Creating a custom date field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
Vikas said:
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.

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.
 
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
 
Back
Top