Solved

Date Validation and Compare Date

Posted on 2011-09-25
5
211 Views
Last Modified: 2012-05-12
Hi,
    Any one help me to over come this problem,  I am using Three date field drop down lists are drdYear,drdMonth,drdDay . From these drop down list i am getting date values into java script, in Java script I validating the date validations like if i select date 31 in Feb i displaying validation Properly. But My Desire is  allow to select 10 days less than current/Present date and don't allow to select greater than the present current/Present date. Could  any one help me.
Thank you.
0
Comment
Question by:CPSRI
  • 3
  • 2
5 Comments
 
LVL 5

Expert Comment

by:softpro2k
ID: 36595212
Hi,

You can use excel function "=Today()". This will return current date.
Now you can do all the comparison and validation as you want with respect to the returned result.

However, you may be already aware that this function entirely depends on the system date.

Regards.

A. Roy
0
 

Author Comment

by:CPSRI
ID: 36595802
HI softpro2k,
    Could you suggest me how to validate that date validation using this excel function. Allowing that 10 days less than the current date.  If you have any code or links send it to me. Thank You.
0
 

Author Comment

by:CPSRI
ID: 36597058
HI ,
  I am implementing this validations in Java script.
0
 
LVL 5

Accepted Solution

by:
softpro2k earned 500 total points
ID: 36597430
Hello,

It would be better if you validate the date in Excel itself and use the result (True or False) in your Javascript or other function.

Considering the date to be validated is entered from Cell A2. you could use the following formula in B2 and drag it to copy the formula downwards :   =IF(AND(TODAY()-A2<=10, TODAY()-A2>=0),"True","False")

Please See attached Image with this formula.

Regards.

A. Roy
Date-Validation.JPG
0
 

Author Closing Comment

by:CPSRI
ID: 36600228
thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

862 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now