Re: Blank Date display problem
- From: "vovan" <v@xxxxx>
- Date: Fri, 29 Feb 2008 21:10:22 -0500
What should be corrected?
It is a common situation when in smalldatetime field we need to have NULL.
For instance the field containing termination date for anything. It should
not contain 1900 if termination did not happen yet. Do you store X in such
situations? Or what? 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?
Thank you
vovan
<christery@xxxxxxxxx> wrote in message
news:a380ad80-054e-4fb5-9d25-dd351139cf86@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On 29 Feb, 19:09, "vovan" <v...@xxxxx> wrote:
I have a table in SQL Server db with the smalldatetime field. Some
records
contain NULL in that field.
If I Select records from the table and display them in the grid then on
some
machines everything is fine, either the real dates or blank values are
displayed in the grid, but on some other machines instead of blank the
user
sees 1900 year.
I do not want to convert date type into string (this fixes the problem)
because the grid has sorting features (click on the header changes sort
order of records by the column) and in case of string type records are
sorted wrong, for instance normal ACS order gives:
01/12/2005
02/22/2006
01/15/2007
If there strings, not dates then records will be displayed as:
01/12/2005
01/15/2007
02/22/2006
How to solve this problem?
Thank you
vovan
A suggestion, fix the data that is corrupt... or rewrite the program
so that the users must correct missing values and store them in the
DB.
and put a X in the field "not null"
//CY
.
- Follow-Ups:
- Re: Blank Date display problem
- From: Ralph
- Re: Blank Date display problem
- From: Steve Gerrard
- Re: Blank Date display problem
- Prev by Date: Re: 'Resetting' a collection with new members .. Is this correct?
- Next by Date: Re: 'Resetting' a collection with new members .. Is this correct?
- Previous by thread: 'Resetting' a collection with new members .. Is this correct?
- Next by thread: Re: Blank Date display problem
- Index(es):
Relevant Pages
|
Loading