Solved

Date Validation and Compare Date

Posted on 2011-09-25
5
224 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
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…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

790 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