Link to home
Start Free TrialLog in
Avatar of VanJava
VanJava

asked on

Credit Card Expiry Date

What is the best datatype to be used to store expiry date of credit card which only needs input of month and year.

Thanks
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

I would choose date, with 01 as day.
Avatar of VanJava
VanJava

ASKER

Is it ok if I'm using number(4)?
ASKER CERTIFIED SOLUTION
Avatar of Muhammad Noman Iqbal
Muhammad Noman Iqbal
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>Is it ok if I'm using number(4)?
you could do so, but why bother to make it more complicated than needed?...

btw: in oracle, to calculate the last dayof the month is called LAST_DAY().
however, as mentioned, I would still use the first day of the month, and calculate the "real" expiry date with:

SYSDATE < ADD_MONTHS(expiry_date, 1)



Avatar of VanJava

ASKER

Thank you all