Solved

Date Validation and Compare Date

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
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 will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

740 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