473,386 Members | 1,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Re: Use TBC in a date field

Paul, you *really* need to head Stuart's advice.

The data types are crucially important in database fields. Non-date values
(like the 3 letters TBC) are not valid dates, and cannot be evaluated as
dates.

On the other hand, Null is a valid and very meaningful value. It will be
processed correctly when you do things like counting the number of dates in
the field, averaging, or finding the nearest date. Using a fake date (such
as 11/11/11) will skew those results badly.

Further, you can *format* the Null value to *display* in any way you want -
using the letters TBC if you wish.

If you do have a field that accepts TBC, then you don't have a date/time
field.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<pa************@hotmail.comwrote in message
news:7f**********************************@r66g2000 hsg.googlegroups.com...
Sorry, i meant that with that format it would only accept null values?

Paul

On Jul 24, 2:24 pm, "paulquinlan...@hotmail.com"
<paulquinlan...@hotmail.comwrote:
Thanks Stuart

The problem, i have now is that when the user actually does type a
date it says "the value you entered isnt valid for this field" and the
only value it will accept is TBC.

Any ideas
Thanks
Paul

On Jul 24, 2:05 pm, "Stuart McCall" <smcc...@myunrealbox.comwrote:
<paulquinlan...@hotmail.comwrote in message
news:e3**********************************@s50g2000 hsb.googlegroups.com...
Hi
I have a bound form that displays a whole load of dates, in several of
these i would like to be able to show "TBC" rather than a blank field.
I'm guessing i could store a date in the fields that would clearly not
be relevent eg. 11/11/1111.
But is it possible where a bound text box contains the date 11/11/1111
to get it to show "TBC"? Ideally i'd also like the users to be able to
type TBC and it automatically store the date 11/11/1111.
Thanks for any suggestions.
Paul
Try this: instead of 11/11/1111, use Null. Then set the format property
for
the textbox to:
;;;"TBC"
To store Null when the user types TBC: Put this code in the textbox's
BeforeUpdate event procedure:
If Me.TextboxName.Value = "TBC" Then
Me.TextboxName.Value = Null
End If- Hide quoted text -

- Show quoted text -
Jul 24 '08 #1
4 2859
Thanks for all this, but when i set the format of the text box
to ;;;"TBC" it then correctly displays TBC when it contains a null
value, however, when the user trys to type an actual date into the
cell it says it isnt a valid for this field??

Thanks again
Paul

On Jul 24, 2:39*pm, "Allen Browne" <AllenBro...@SeeSig.Invalidwrote:
Paul, you *really* need to head Stuart's advice.

The data types are crucially important in database fields. Non-date values
(like the 3 letters TBC) are not valid dates, and cannot be evaluated as
dates.

On the other hand, Null is a valid and very meaningful value. It will be
processed correctly when you do things like counting the number of dates in
the field, averaging, or finding the nearest date. Using a fake date (such
as 11/11/11) will skew those results badly.

Further, you can *format* the Null value to *display* in any way you want-
using the letters TBC if you wish.

If you do have a field that accepts TBC, then you don't have a date/time
field.

--
Allen Browne - Microsoft MVP. *Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<paulquinlan...@hotmail.comwrote in message

news:7f**********************************@r66g2000 hsg.googlegroups.com...
Sorry, i meant that with that format it would only accept null values?

Paul

On Jul 24, 2:24 pm, "paulquinlan...@hotmail.com"

<paulquinlan...@hotmail.comwrote:
Thanks Stuart
The problem, i have now is that when the user actually does type a
date it says "the value you entered isnt valid for this field" and the
only value it will accept is TBC.
Any ideas
Thanks
Paul
On Jul 24, 2:05 pm, "Stuart McCall" <smcc...@myunrealbox.comwrote:
<paulquinlan...@hotmail.comwrote in message
>news:e3**********************************@s50g200 0hsb.googlegroups.com....
Hi
I have a bound form that displays a whole load of dates, in severalof
these i would like to be able to show "TBC" rather than a blank field.
I'm guessing i could store a date in the fields that would clearly not
be relevent eg. 11/11/1111.
But is it possible where a bound text box contains the date 11/11/1111
to get it to show "TBC"? Ideally i'd also like the users to be ableto
type TBC and it automatically store the date 11/11/1111.
Thanks for any suggestions.
Paul
Try this: instead of 11/11/1111, use Null. Then set the format property
for
the textbox to:
;;;"TBC"
To store Null when the user types TBC: Put this code in the textbox's
BeforeUpdate event procedure:
If Me.TextboxName.Value = "TBC" Then
Me.TextboxName.Value = Null
End If- Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
Jul 24 '08 #2
What happens if you expand the first parts:
mm/dd/yyyy;mm/dd/yyyy;mm/dd/yyyy;"TBC"

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
<pa************@hotmail.comwrote in message
news:28**********************************@a70g2000 hsh.googlegroups.com...
Thanks for all this, but when i set the format of the text box
to ;;;"TBC" it then correctly displays TBC when it contains a null
value, however, when the user trys to type an actual date into the
cell it says it isnt a valid for this field??

Thanks again
Paul

On Jul 24, 2:39 pm, "Allen Browne" <AllenBro...@SeeSig.Invalidwrote:
Paul, you *really* need to head Stuart's advice.

The data types are crucially important in database fields. Non-date values
(like the 3 letters TBC) are not valid dates, and cannot be evaluated as
dates.

On the other hand, Null is a valid and very meaningful value. It will be
processed correctly when you do things like counting the number of dates
in
the field, averaging, or finding the nearest date. Using a fake date (such
as 11/11/11) will skew those results badly.

Further, you can *format* the Null value to *display* in any way you
want -
using the letters TBC if you wish.

If you do have a field that accepts TBC, then you don't have a date/time
field.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<paulquinlan...@hotmail.comwrote in message

news:7f**********************************@r66g2000 hsg.googlegroups.com...
Sorry, i meant that with that format it would only accept null values?

Paul

On Jul 24, 2:24 pm, "paulquinlan...@hotmail.com"

<paulquinlan...@hotmail.comwrote:
Thanks Stuart
The problem, i have now is that when the user actually does type a
date it says "the value you entered isnt valid for this field" and the
only value it will accept is TBC.
Any ideas
Thanks
Paul
On Jul 24, 2:05 pm, "Stuart McCall" <smcc...@myunrealbox.comwrote:
<paulquinlan...@hotmail.comwrote in message
>news:e3**********************************@s50g200 0hsb.googlegroups.com...
Hi
I have a bound form that displays a whole load of dates, in several
of
these i would like to be able to show "TBC" rather than a blank
field.
I'm guessing i could store a date in the fields that would clearly
not
be relevent eg. 11/11/1111.
But is it possible where a bound text box contains the date
11/11/1111
to get it to show "TBC"? Ideally i'd also like the users to be able
to
type TBC and it automatically store the date 11/11/1111.
Thanks for any suggestions.
Paul
Try this: instead of 11/11/1111, use Null. Then set the format
property
for
the textbox to:
;;;"TBC"
To store Null when the user types TBC: Put this code in the textbox's
BeforeUpdate event procedure:
If Me.TextboxName.Value = "TBC" Then
Me.TextboxName.Value = Null
End If- Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
Jul 24 '08 #3
Thanks a lot guys, thats done the trick!

On Jul 24, 3:40*pm, "Allen Browne" <AllenBro...@SeeSig.Invalidwrote:
What happens *if you expand the first parts:
* * mm/dd/yyyy;mm/dd/yyyy;mm/dd/yyyy;"TBC"

--
Allen Browne - Microsoft MVP. *Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.<paulquinlan...@hotmail.comwrote in message

news:28**********************************@a70g2000 hsh.googlegroups.com...
Thanks for all this, but when i set the format of the text box
to ;;;"TBC" it then correctly displays TBC when it contains a null
value, however, when the user trys to type an actual date into the
cell it says it isnt a valid for this field??

Thanks again
Paul

On Jul 24, 2:39 pm, "Allen Browne" <AllenBro...@SeeSig.Invalidwrote:
Paul, you *really* need to head Stuart's advice.
The data types are crucially important in database fields. Non-date values
(like the 3 letters TBC) are not valid dates, and cannot be evaluated as
dates.
On the other hand, Null is a valid and very meaningful value. It will be
processed correctly when you do things like counting the number of dates
in
the field, averaging, or finding the nearest date. Using a fake date (such
as 11/11/11) will skew those results badly.
Further, you can *format* the Null value to *display* in any way you
want -
using the letters TBC if you wish.
If you do have a field that accepts TBC, then you don't have a date/time
field.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
<paulquinlan...@hotmail.comwrote in message
news:7f**********************************@r66g2000 hsg.googlegroups.com....
Sorry, i meant that with that format it would only accept null values?
Paul
On Jul 24, 2:24 pm, "paulquinlan...@hotmail.com"
<paulquinlan...@hotmail.comwrote:
Thanks Stuart
The problem, i have now is that when the user actually does type a
date it says "the value you entered isnt valid for this field" and the
only value it will accept is TBC.
Any ideas
Thanks
Paul
On Jul 24, 2:05 pm, "Stuart McCall" <smcc...@myunrealbox.comwrote:
<paulquinlan...@hotmail.comwrote in message
news:e3**********************************@s50g2000 hsb.googlegroups.com...
Hi
I have a bound form that displays a whole load of dates, in several
of
these i would like to be able to show "TBC" rather than a blank
field.
I'm guessing i could store a date in the fields that would clearly
not
be relevent eg. 11/11/1111.
But is it possible where a bound text box contains the date
11/11/1111
to get it to show "TBC"? Ideally i'd also like the users to be able
to
type TBC and it automatically store the date 11/11/1111.
Thanks for any suggestions.
Paul
Try this: instead of 11/11/1111, use Null. Then set the format
property
for
the textbox to:
;;;"TBC"
To store Null when the user types TBC: Put this code in the textbox's
BeforeUpdate event procedure:
If Me.TextboxName.Value = "TBC" Then
Me.TextboxName.Value = Null
End If- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
Jul 24 '08 #4
"Allen Browne" <Al*********@SeeSig.Invalidwrote in message
news:48***********************@per-qv1-newsreader-01.iinet.net.au...
Clarification, Stuart:

These are numeric values, so the 3rd one is zero (not a zls.)

Dates can be zero (Dec 30 1999) or negative (before that.)
Right you are. Makes sense now you mention it. Thankyou.

However, after running a few tests, it seems that the middle two sections
are ignored when the data type is Date. At least I can't make it happen...
Jul 24 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: usenet | last post by:
I have inherited a table where date information was saved from PHP as a VARCHAR. (Sigh.) This means that the so-called date fields look like this : August 1, 2005, 9:09 am EDT October 13, 2004,...
1
by: Liz Malcolm | last post by:
Hello and TIA. I have a DE form with an option group that if daily is selected todays date is used for start and end date, if weekly is selected Monday - Friday is used. I am trying to add a...
4
by: S. van Beek | last post by:
Dear reader, By a Date field with Now() as default value the content of the field is date plus time. As I need a filter in a query on date only (excluding time) I invented the following...
1
by: Graham Feeley | last post by:
I have a date field named rcdate it is a general date eg: 12/08/2006 3:30:00 PM 12/08/2006 3:00:00 PM I used to update another empty field named rdate with the with using in a update query "...
3
by: Pavkovich | last post by:
I have tried to set a date field when I put a checkmark in a yes/no field. In the date fields control source I put the following: IIf(=0," ",Date()) Unfortunately using Date() simply changes the...
4
by: andrewbda | last post by:
I have tickbox on a form, and I would like to use a date field as the control source. i.e. I would like to have it display as ticked when a date exists in the field, and vice versa. Also,...
3
by: Finn Stampe Mikkelsen | last post by:
Hi I have defined a table in my database, with 2 date-fields. I have set a default value to DBNull. I have integrated a nullable datetimepicker control to my project and set the apropriate...
7
by: sheri | last post by:
I have a field called date, the date is in the field like this 70925 (which means Sept. 25, 2007). I have another field called day, it is a text field. How do I write a query to populate the day...
10
by: Jes | last post by:
Dear all I have a date field on a HTML form where the user is asked to key in dd/mm/yyyy However, when that is written to MySql it is either not accepted or another value is tored in the...
8
beacon
by: beacon | last post by:
Hi everybody, I'm having a terrible time trying to accomplish what I thought would be extremely easy. I have three date fields on a form (DischargeDate, ReceivedDate, and AuditedDate) and I'm...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.