Solved

Date Validation and Compare Date

Posted on 2011-09-25
5
198 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
Comment Utility
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
Comment Utility
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
Comment Utility
HI ,
  I am implementing this validations in Java script.
0
 
LVL 5

Accepted Solution

by:
softpro2k earned 500 total points
Comment Utility
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
Comment Utility
thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

743 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

16 Experts available now in Live!

Get 1:1 Help Now