Re: Blank Date display problem
- From: "Steve Gerrard" <mynamehere@xxxxxxxxxxx>
- Date: Fri, 29 Feb 2008 18:39:10 -0800
vovan wrote:
A couple of years
ago I read a big discussion on one of the programming forums about
using NULLs in date type of fields. As I remember some of people did
not want to use NULLs. Many others insisted on using NULLs when it
requires, for instance the date of death. Until the person is alive
this field contains NULL, not 1900, not X, not 'NOT SET'. Just NULL.
Who of those people were wrong. That discussion did not give any
answer. Most of the workstations running my project display blank field in
the grid if the date was not set yet. Only one workstation displays
1900 instead of blank for the same records from the same database.
Is it the fault of the program? Should it be rewritten, you think?
Null is pretty much inevitable if you work with databases much, even if you
don't store them directly.
Suppose you run a query with a left join, asking for each customer name from the
customer table, and the date of their latest purchase from the related purchases
table. You use a left join so that customers with no purchases will still be
included in the list. Guess what every database engine in the world will return
for the date of their latest purchase, if there are none? If you said Null, you
are right.
So stick with Null, you'll have to get used to it anyway. As for the rogue
machine that displays Null as 1900, I would say something is weird on their
machine. Do they have the exact same program? It is possible to format Nulls as
'1900', although why anyone would do that I do not know. I can't imagine it is a
setting in Windows. Maybe they need to reinstall some stuff. :)
.
- References:
- Re: Blank Date display problem
- From: vovan
- Re: Blank Date display problem
- Prev by Date: Re: 'Resetting' a collection with new members .. Is this correct?
- Next by Date: Re: Need VB 6.0 Practical DLL Reference...
- Previous by thread: Re: Blank Date display problem
- Next by thread: Re: Blank Date display problem
- Index(es):
Relevant Pages
|