Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Blank datetime field
Message
From
18/10/2006 09:52:06
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
17/10/2006 22:52:59
Arjun Bagojikop
Dynamic Super Software
Sangli, India
General information
Forum:
Microsoft SQL Server
Category:
Database management
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01162805
Message ID:
01162925
Views:
18
This message has been marked as the solution to the initial question of the thread.
>hi
>friends
>i am vfp programmer using sql 2000. i have created cursoradapter in my dataenvironment using cursor in from. my user fill blank date
>after cursor updated store datetime in sql '01/01/1900 12:00:00 am'.
>user want to store blank datetime i have try to save null value. when user adding new record default null but user go on datetime text box mistakly type date. he want no need date here,he arase date and saveing record but datetime have been stored in sql
>'01/01/1900 12:00:00 am'.
>
>Plese Suggest me how can i stored blank date in sql 20

As Boris noted,
You should never let blank datetimes if data is going to SQL server. Behind the scenes it's converted to lowest possible datetime (which of course is not true - disables the ability to diffferentiate a valid date from a date that was never specified). Unfortunately that problem is well known and still continues to exists with SQL2005.
For datetime on SQL server side you should allow nulls. Before sending data back you should replace all blank dates with nulls yourself (ie: in datetime fields valid you can do that

if !isnull(this.Value) and empty(this.Value)
this.Value = .null.
endif

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform