two-digit year in date field of access table: how to query

  • Thread starter Thread starter JJ_377
  • Start date Start date
J

JJ_377

Access table stores "date" in field this way:
06/05 where 06 is the month and 05 is the year.

Oldest records have values in the date field such as:
05/98, 05/82

How to query this table to get records for years between
2005 and 2003?

Is there anyway to convert the two-digit years to four (easily) before
querying? I know how to extract the year portion by using the right
function.

Ideas?

Many thanks.
 
Access table stores "date" in field this way:
06/05 where 06 is the month and 05 is the year.

Oldest records have values in the date field such as:
05/98, 05/82

How to query this table to get records for years between
2005 and 2003?

Is there anyway to convert the two-digit years to four (easily) before
querying? I know how to extract the year portion by using the right
function.

Are you using a Text field or an actual Date/Time field? If the latter then
what you see is merely a display format and has nothing to do with how the
dates are stored or how you would query them. Date/times are always stored
exactly the same regardless of any format you might choose.
 
Access table stores "date" in field this way:
06/05 where 06 is the month and 05 is the year.

Oldest records have values in the date field such as:
05/98, 05/82

How to query this table to get records for years between
2005 and 2003?

Is there anyway to convert the two-digit years to four (easily) before
querying? I know how to extract the year portion by using the right
function.

Ideas?

Many thanks.

If the "date" is stored as text in a text field then you should be able
to change that 98 to 1998. I suggest you may want to take it a little
farther and split your month and year into different fields so you can sort
easier. Or on the other hand, I would use a read data field.

If you don't want to or can't change the format to a four character
year, then you would use where *03 or *04 or *05
 
I agree with you both; good ideas!

I'm leaning towards splitting the current field (which I'm pretty sure
would be text...) into a month field and a year field: then I avoid
coding around the problem. I would leave the original field alone so I
don't break existing queries, code and eceteras.

Also BTW: what is a "read data field"?

Thank you very much Joe and Rick.
 
I agree with you both; good ideas!

I'm leaning towards splitting the current field (which I'm pretty sure
would be text...) into a month field and a year field: then I avoid
coding around the problem. I would leave the original field alone so I
don't break existing queries, code and eceteras.

Also BTW: what is a "read data field"?

My bad ... A typo The should have been "real date field"
 
Back
Top