?
Solved

Verify Credit Card Expiry date as VALID

Posted on 2005-03-01
2
Medium Priority
?
2,645 Views
Last Modified: 2008-01-09
Hi,

I need to verify 2 input fields for validation.
I have a site where clients input their credit card information in the following manner
credit card number: text box
expiry month: drop menu
expiry year: drop menu

The values are place in the database as follows:
Field CC_NUMBER
Field CC_EXP_MONTH
Field CC_EXP_YEAR

My Question,

How can I verify that the credit card being added by the client is NOT expired, BY checking the values of the CC_EXP_MONTH and CC_EXP_YEAR, vs the current date

I use ASP and VB on a SQL 2000 Database

Thanks
Steve

0
Comment
Question by:TO_Steve
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 8

Expert Comment

by:fozylet
ID: 13431338
ExpiryDate = DateSerial(CC_EXP_YEAR,CC_EXP_MONTH,1)
If DateDiff("d",Date,ExpiryDate)<0 Then
    'Card expired...
Else
    'Card valid
End If
0
 
LVL 8

Accepted Solution

by:
fozylet earned 2000 total points
ID: 13431352
If last day of the expiry month is the date until which the card works, do this...

ExpiryDate = DateSerial(CC_EXP_YEAR,CC_EXP_MONTH+1,0)

this will return the last day of the month. rest is the same...
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question