[thelist] 1/1/1900 SQL Server/ASP Question

Chris Blessing webguy at mail.rit.edu
Wed Jan 16 13:52:55 CST 2002


I assume you're using the smalldatetime data type for your field.  1/1/1900
is the smallest date that field can accomodate, and I'm guessing that since
you're occassionally throwing an empty date in there, that it's defaulting
to 1/1/1900 to avoid data type errors (because an empty string is not of a
smalldatetime format).

What do you want to have in that field if you try to do an update with an
empty value for t_cr_ccss_review_date?  If you want anything other than a
date, you'll have to use some other field data type.

Chris Blessing
webguy at mail.rit.edu
http://www.330i.net

> -----Original Message-----
> From: thelist-admin at lists.evolt.org
> [mailto:thelist-admin at lists.evolt.org]On Behalf Of josh
> Sent: Wednesday, January 16, 2002 2:47 PM
> To: thelist at lists.evolt.org
> Subject: [thelist] 1/1/1900 SQL Server/ASP Question
>
>
> I am updating a database field via a web form.  When a date is
> placed in the
> field the database updates correctly.  When the form is left blank, the
> database assumes the value 1/1/1900.
>
> Here is the database update call:
>
> <code snippet>
>
> rs.Open "UPDATE t_table SET t_cr_ccss_review_date = '" &
> request.form("the_date") & "' WHERE id=" & request.form("id")
>
> </code snippet>
>
> Does anyone know what I have done wrong?
>
> Thanks,
> Josh
>
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt !





More information about the thelist mailing list