Ask a Question related to ASP Database, Design and Development.
-
Brent #1
Dates in SQL Server
Hello,
I have an ASP form that has a Date field. The form is used to update data in an SQL Server. The problem I have is that when the user updates the date to say 01/07/2003, the date is saved to the Table as 01/01/1900. If anyone has any ideas, it would be appreciated.
Thanks.
Brent Guest
-
Between Dates
I am trying to query an online access database and return records that have occurred between dates. I am using another query which does work to... -
ASP/VBS Dates Between Dates
I'm trying to filter records depending on 2 dates requested from the querystring MMColParam1 (startdate) and MMColParam2 (enddate), i.e. a list... -
Dates
Thanks to all those who replied. I ended up doing some research myself and found a good date module at... -
can't insert dates in SQL Server 2000
Perhaps that's because what you're actually converting is 31 divided by 7 divided by 2003 instead of the string '31/07/2003'. Ray at home --... -
Server has converted dates from dd/mm/yyyy to mm/dd/yyy
YOUR profile says dd/mm/yyyy. However, asp does not run using your profile. Check the profile of the IUSR account, and any other profile that exists... -
CJM #2
Re: Dates in SQL Server
By far the best way to handle dates is to convert them to ISO date format:
20040116 would work, but 2004-01-16 is better (works on Access too).
Times should follow the hh:mm:ss format.
When you pull the dates out again they should be in a suitable format, but
if not you can set Session.LCID to an
appropriate value for you country.
hth
CJM
"Brent" <anonymous@discussions.microsoft.com> wrote in message
news:C6E1CD30-B8FD-468A-B3FD-096519E8548C@microsoft.com...in an SQL Server. The problem I have is that when the user updates the date> Hello,
>
> I have an ASP form that has a Date field. The form is used to update data
to say 01/07/2003, the date is saved to the Table as 01/01/1900. If anyone
has any ideas, it would be appreciated.>
> Thanks.
CJM Guest
-
Steve G #3
Re: Dates in SQL Server
For SQL server, as opposed to SQL Server 2000:
From the Microsoft Knowledge Base:
SYMPTOMS
Any local variable of fixed length for which there is an implicit or
explicit conversion to SMALLDATETIME will inadvertently convert NULL to the
default date Jan 1, 1900 12:00AM.
A fixed length binary variable will also convert NULL to the default date
when the IMPLICIT conversion is to DATETIME.
WORKAROUND
To work around this problem, use variables of variable length rather than
fixed length.
STATUS
Microsoft has confirmed this to be a problem in SQL Server versions 4.2x,
6.0, and 6.5. We are researching this problem and will post new information
here in the Microsoft Knowledge Base as it becomes available.
HTH
Steve G
"Brent" <anonymous@discussions.microsoft.com> wrote in message
news:C6E1CD30-B8FD-468A-B3FD-096519E8548C@microsoft.com...in an SQL Server. The problem I have is that when the user updates the date> Hello,
>
> I have an ASP form that has a Date field. The form is used to update data
to say 01/07/2003, the date is saved to the Table as 01/01/1900. If anyone
has any ideas, it would be appreciated.>
> Thanks.
Steve G Guest
-
Aaron Bertrand [MVP] #4
Re: Dates in SQL Server
> 20040116 would work, but 2004-01-16 is better (works on Access too).
Actually, the latter can break in SQL Server. The two "unbreakable" formats
for SQL Server are:
YYYYMMDD
YYYY-MM-DDTHH:MM:SS[.sss]
Note that the T is literal, e.g. 2004-01-16T11:04:32.444
And of course, Access doesn't accept either of those, and your suggestion is
the only "unbreakable" format I know for Access.
--
Aaron Bertrand
SQL Server MVP
[url]http://www.aspfaq.com/[/url]
data> Times should follow the hh:mm:ss format.
>
> When you pull the dates out again they should be in a suitable format, but
> if not you can set Session.LCID to an
> appropriate value for you country.
>
> hth
>
> CJM
>
> "Brent" <anonymous@discussions.microsoft.com> wrote in message
> news:C6E1CD30-B8FD-468A-B3FD-096519E8548C@microsoft.com...> > Hello,
> >
> > I have an ASP form that has a Date field. The form is used to updatedate> in an SQL Server. The problem I have is that when the user updates theanyone> to say 01/07/2003, the date is saved to the Table as 01/01/1900. If> has any ideas, it would be appreciated.>> >
> > Thanks.
>
Aaron Bertrand [MVP] Guest
-
David Morgan #5
Re: Dates in SQL Server
Are you sure the date field is not "time only"?
"Brent" <anonymous@discussions.microsoft.com> wrote in message
news:C6E1CD30-B8FD-468A-B3FD-096519E8548C@microsoft.com...in an SQL Server. The problem I have is that when the user updates the date> Hello,
>
> I have an ASP form that has a Date field. The form is used to update data
to say 01/07/2003, the date is saved to the Table as 01/01/1900. If anyone
has any ideas, it would be appreciated.>
> Thanks.
David Morgan Guest



Reply With Quote

