By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,483 Members | 1,544 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,483 IT Pros & Developers. It's quick & easy.

Validation Rule with two options

P: n/a
I have a field for which I need the data entered to either be in the
form of a date, OR to be "N/A". How can I write a validation rule (or
is there another option?) to allow for either of these? Selecting
data type Date/Time does not allow for text but I need both.

Please help!
Thank you :o)

Sep 12 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a

There's no *absolute* way to make sure a date is entered into a text
field, but you can use the IsDate function to find out if some text can
be converted into a date.

Unfortunately, IsDate("12/31/2007") = true, as does "31/12/2007", as
well as "Dec 12, 2007", and "12 Dec 2007".

So, depending upon what you mean by a "date", you may have to create a
function to make sure it's in the format you expect.

A wiser move might allow for a date of something like Dec 30, 1899 to
mean "N/A". Or, probably more appropriately, allow for Nulls in that
date field. (Null = "I Don't Know", or "Not Applicable".)

SK*******@gmail.com wrote:
I have a field for which I need the data entered to either be in the
form of a date, OR to be "N/A". How can I write a validation rule (or
is there another option?) to allow for either of these? Selecting
data type Date/Time does not allow for text but I need both.

Please help!
Thank you :o)
Sep 12 '07 #2

P: n/a
SK*******@gmail.com wrote in
news:11**********************@22g2000hsm.googlegro ups.com:
I have a field for which I need the data entered to either be in
the form of a date, OR to be "N/A". How can I write a validation
rule (or is there another option?) to allow for either of these?
Selecting data type Date/Time does not allow for text but I need
both.

Please help!
Thank you :o)
Unfortunately, you cannot put "N/A" in a date field.
You can have a date field and a checkbox that indicates that the date
should be "N/A". You can even make the datefield invisible or disabled
based on the checbox status.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Sep 12 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.