Date Format - Credit Card Expiry

J

John Smith

Hi, This should be simple for you guys.

We need to record credit card details including "Expiry Date" in the form of
"DD/YY".

How do we best format the field for easy entry AND validation (i.e. as a
date field and not just as a text field) without having to enter anything
other than just the month and year and with the result not showing up as
day, month year?

Please help as it is driving me nuts.
 
A

Alex White MCDBA MCSE

Don't use a date field, use a string and validate the format are you sure
it's DD/YY rather than MM/YY, the other thing would be use a date field and
always set the day to 01 because you never need it, it should not be a
problem and on your screen always display MM/YY so dropping the day portion
on the screen and any reports.
 
J

John Smith

I guess it would help if I could type - yes I do mean MM/YY of course.

Can you explain what you mean by "always set the day to 01" how do I do this
in the table design or is this effected in the form?

Thanks for helping.
 
A

Alex White MCDBA MCSE

Hi John,

I have done a bit of testing I think using the date field type is not going
to yield the results you want, either use a text field type with a length of
4 with a format of "99/99" and an input mask of 99/99 or think about
splitting the month and year into 2 different fields, 1 for month and 1 for
year both text length 2,
 
J

John Smith

Some things just aren't simple are they.

I can see your point of a text field (length 4 or 5 to accomodate the "/"
?).

I would then need to validate the last two characters against the current
year and then possibly the first two against the current month.

Thanks for all your input.
 
R

Rick B

John:

Personally, I have done this with TWO text fields. I created a drop down
list for the 12 months and a drop-down list for the next 15 years.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top