>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