Setting default values?

dgmorr

Registered User.
Local time
Today, 04:40
Joined
Jan 10, 2007
Messages
71
Hey guys,

I'm not sure how to do this, and I can't find any info about it, but is it possible to set a value for my date field to accept either

1) date
2) "TBD"
3) null

Is there a way to allow and exception of "TBD"?
 
A Date field is a numeric field and will not accept the string "TBD".
 
A Date field is a numeric field and will not accept the string "TBD".

Are there any exceptions to this? How about an alternative? I would like to have the medium date format, but also allow a TBD.
 
Then you will need to change your field's datatype to text and store it as text. You can store a date as text but you will need to convert it in formulas to do calculations on it and in order to do calculations on it, since some rows will have TBD, you will have to convert the TBD's to a specific date before converting to a date.

So the best thing to do is to come up with another way to display TBD, but not store it (such as setting a boolean field within the table as yes for TBD and then you can display it in the text box as TBD if the checkbox is checked and the date field is null).
 
Medium Date is simply a display option. AFAIK there is no way to put a string in a numeric field.
 
Bob's solution will work (add a boolean TBD field) and RG is right in that a date field will not hold a string like "TBD". One other option is to set an arbitrary date to be your TBD date, some date that we'll never hit in our lifetime. For example, you could set 5/5/5555 and internally know that means "TBD", even though it will display 5/5/5555. Then, you can filter for it using a standard date field.

If YourDateField <> "5/5/5555" Then YourDateField Else "TBD"
 

Users who are viewing this thread

Back
Top Bottom