Solved

Date Validation and Compare Date

Posted on 2011-09-25
5
232 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
[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
  • 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Suggested Solutions

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

737 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