• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1102
  • Last Modified:

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
0
VanJava
Asked:
VanJava
  • 2
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I would choose date, with 01 as day.
0
 
VanJavaAuthor Commented:
Is it ok if I'm using number(4)?
0
 
Muhammad Noman IqbalCommented:
one option could be you use date data type, and put the day as last day of the month in that case when you take input from gui you will be calculating the last day of month.

In this case when you compare your date on which your credit card transaction is happening, comparison would be easy rather extracting the month from date you will compare the dates.

Thanks
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>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)



0
 
VanJavaAuthor Commented:
Thank you all
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now