Re: Blank Date display problem



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


.



Relevant Pages

  • Re: Optimizing for speed
    ... > Simple query which returns ... I'd like to inmediately display records and allow user ... >> I'd consider is how much data am I loading in the grid vs. what the user ... >> in others where this isn't the bottleneck the differences aren't worth ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Label will not display NEW records frm another (bound) form.
    ... The GRID form was written in Visual Basic. ... that person’s name in a label control of a second unbound form. ... Its purpose is to display the results ... past Registrations. ...
    (microsoft.public.access.formscoding)
  • Graphics - need to draw to the screen and then erase it
    ... and then use lines to create a grid. ... I then draw sine-waves ontop of the ... So the user presses on the display with the stylus and a line is ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Label will not display NEW records frm another (bound) form.
    ... The GRID form was written in Visual Basic. ... that person’s name in a label control of a second unbound form. ... Its purpose is to display the results ... past Registrations. ...
    (microsoft.public.access.formscoding)
  • Re: Optimizing for speed
    ... The query itself is fast, it's actually the loop that reads all the records ... I'd like to inmediately display records and allow user ... > I'd consider is how much data am I loading in the grid vs. what the user ... > in others where this isn't the bottleneck the differences aren't worth ...
    (microsoft.public.dotnet.framework.compactframework)

Loading