Access 97 Date Comparison - TechRepublic
General discussion
February 13, 2004 at 05:33 AM
mra2

Access 97 Date Comparison

by mra2 . Updated 22 years, 4 months ago

I have an Access 97 Application which posts Monthly dues. I want to stop accidental ADVANCE (Greater than current Month & Year) posting of dues.
There is a List box where the year is selected and a button for each month. So the date comes out as [yearbox] + month. For example 200312 or 200302. (I hardcoded 01, 02 through 12.)
Now to compare the posting month/year with the present Month/Year to stop advance posting by accident. I took datepart(“yyyy,date) & datepart(“m”,date)
But it does not work correctly because I get for Dec 200412 and for January 20041. With the zero missing in months 1-9 the less than comparison get the WRONG ANSWER.

Any ideas???????????????
Alan
Abramowitza@coned.com

This discussion is locked

All Comments