Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datetime Problem - Null Defaulting to 1/1/1900

Status
Not open for further replies.

galexander

Programmer
Joined
Jan 17, 2002
Messages
2
Location
US
I am running a stored procedure from an .asp page (ADO). Some of the parameters are dates. When it passes a null date to the procedure, the value that is stored in the table is 1/1/1900. Is there anything that I can do to have the null value stored as a null value? I am working in SQL7. Here is the procedure

ALTER Procedure WEBData_AdminUpdate
@app_num_prelim varchar(15),
@App_num char(15),
@LoanID char(15),
@ConvOption int,
@PPPenOption int,
@NoteRate float,
@ExpDate datetime,
@TotalPrice float,
@SecSRP float,
@SecCaps float,
@SecIndex_ float,
@SecMargin float,
@DaysLocked int,
@ConfBy char(15),
@ChangeDate datetime,
@InvLoanNumber varchar(25),
@Status int,
@Comments varchar(500),
@LastUpdatedBy char(15)
AS

UPDATE LOAN SET
App_num = @app_num,
LoanID=@LoanID,
ConvOption = @ConvOption,
PPPenOption = @PPPenOption,
NoteRate = @NoteRate,
ExpDate = @ExpDate,
TotalPrice = @TotalPrice,
SecSRP = @SecSRP,
SecCaps = @SecCaps,
SecIndex_ = @SecIndex_,
SecMargin = @SecMargin,
DaysLocked = @DaysLocked,
ConfBy = @ConfBy,
ChangeDate = @ChangeDate,
InvLoanNumber = @InvLoanNumber,
Status=@Status,
Comments=UPPER(@Comments),
LastUpdated = GetDate(),
LastUpdatedBy = @LastUpdatedBy

FROM
LOAN
WHERE Loan.app_num_prelim = @app_num_prelim

Anyone's help is greatly appreciated.

Thanks!
 
If the field is defined to allow nulls and has no default assigned then it should be nulls if you don't update it. The date 1/1/1900 reflects a zero being put into the field or a default of zero - somehow you are getting a zero in the field.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top