Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Date problem - 01/01/1900


Message #1 by "Eunice Chia" <eunice@a...> on Thu, 21 Feb 2002 06:30:40
Hi,



I am using MS SQL Server. I have a table that has a ReturnDate of datatype 

Date/Time.



When inserting a record, I can insert a Null value by not specifying the 

column (ReturnDate) in the insert statement.



BUT... anything to do with updating of the date field to empty or null 

will result in 01/01/1900. And, I can't use a default value coz it not 

only confuses users, it also show meaningless data.



Eg) it's meaningless and confusing if i display a date field (using a 

default value or having 01/01/1900) which signifies the Return Date of a 

book in a library system.



I'm still looking for a way around this. Can anyone help?

Message #2 by "Ken Schaefer" <ken@a...> on Fri, 22 Feb 2002 10:32:21 +1100
Inserting a NULL value shouldn't result in a date of 01/01/1900

Instead, the field should show NULL. I think you are inserting the wrong

date if you are getting 01/01/1900



If you want more help, I suggest you *post the code you are using* so we can

see if there is any problem with it.



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From: "Eunice Chia" <eunice@a...>

Subject: [asp_web_howto] Date problem - 01/01/1900





: I am using MS SQL Server. I have a table that has a ReturnDate of datatype

: Date/Time.

:

: When inserting a record, I can insert a Null value by not specifying the

: column (ReturnDate) in the insert statement.

:

: BUT... anything to do with updating of the date field to empty or null

: will result in 01/01/1900. And, I can't use a default value coz it not

: only confuses users, it also show meaningless data.

:

: Eg) it's meaningless and confusing if i display a date field (using a

: default value or having 01/01/1900) which signifies the Return Date of a

: book in a library system.

:

: I'm still looking for a way around this. Can anyone help?



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Message #3 by "Eunice Chia" <eunice@a...> on Fri, 22 Feb 2002 01:50:22
Hi Ken,



Thanks for pointing out where I could have gone wrong. I realised I have 

been trying to update the column wrongly.



Thanks again! :)



Cheers,

Eunice



> Inserting a NULL value shouldn't result in a date of 01/01/1900

> Instead, the field should show NULL. I think you are inserting the wrong

> date if you are getting 01/01/1900

> 

> If you want more help, I suggest you *post the code you are using* so we 

can

> see if there is any problem with it.

> 

> Cheers

> Ken

> 

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> From: "Eunice Chia" <eunice@a...>

> Subject: [asp_web_howto] Date problem - 01/01/1900

> 

> 

> : I am using MS SQL Server. I have a table that has a ReturnDate of 

datatype

> : Date/Time.

> :

> : When inserting a record, I can insert a Null value by not specifying 

the

> : column (ReturnDate) in the insert statement.

> :

> : BUT... anything to do with updating of the date field to empty or null

> : will result in 01/01/1900. And, I can't use a default value coz it not

> : only confuses users, it also show meaningless data.

> :

> : Eg) it's meaningless and confusing if i display a date field (using a

> : default value or having 01/01/1900) which signifies the Return Date of 

a

> : book in a library system.

> :

> : I'm still looking for a way around this. Can anyone help?

> 

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> 


  Return to Index