Ask a Question related to ASP Database, Design and Development.
-
Ray at #1
Re: 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
--
Will trade ASP help for SQL Server help
"Nick" <ektorjr@hol.gr> wrote in message
news:355901c35544$26d7cd80$a001280a@phx.gbl...> Hello
>
> Suppose many of you have faced this problem before. I try
> to insert a date form my ASP page in SQL Server 2000 (in
> a smalldatetime datatype), but this seems impossible.
>
> After receiveing many error messages i found that i had
> to use the Convert function in my query. Well, I am using:
>
> update games set game_date=CONVERT(smalldatetime,
> 31/07/2003)
>
> The query works fine, but it inserts the value 01/01/1900
> in the database. I also tried others formats of the date
> (07/31/2003 etc.) but nothing works.
>
> It would be gretaly appreciated if could have a code
> snippet with an insert statement for SQL Server from ASP
> contaning dates.
>
> Thanks in advance.
>
> Nick
>
Ray at Guest
-
Problem with insert dates
Hi, I have a problem on my CFMX 6.1 server. When I try to insert a date in a access DB it insert not the right date but the right date less one... -
Access 2000 and Dates going wrong
Hi, Can anyone tell me how to fix my date problem in MX2004 and Access 2000. I have a table where I am trying to only get records of a certain... -
Problem with insert dates in SQL
Hi, I have a table with a camp "Fecha" (it is datetime).I insert a date in this format: dd/mm/yy (for example 01/11/2003) but in the table the... -
Error in COM+ while migrating from 2000 Server to 2000 Advace Server
Hi, I have one 3 tier architecture application running on Windows 2000 Server. I have created replica of same machine on another machine where OS... -
Error while porting applicaition from 2000 Server to 2000 advace Server
Hi, I have one 3 tier architecture application running on Windows 2000 Server. I have created replica of same machine on another machine where OS... -
Aaron Bertrand - MVP #2
Re: can't insert dates in SQL Server 2000
> update games set game_date=CONVERT(smalldatetime,
Dates are strings, not numbers, at least in this context (storage is another> 31/07/2003)
issue).
So, you need to use quotes.
Also, you should try and avoid regionally formatted dates, they introduce
ambiguity and potential errors / data corruption. Try:
UPDATE games SET game_date = '2003-07-31'
A
Aaron Bertrand - MVP Guest
-
Aaron Bertrand - MVP #3
Re: can't insert dates in SQL Server 2000
Actually, safer without the dashes
UPDATE games SET game_date = '20030731'
Aaron Bertrand - MVP Guest
-
Nikos Drandakis #4
Re: can't insert dates in SQL Server 2000
I used quotes at first, but I alwys received an error mesage. When i
tried this it worked. So I assumed that, within the convert function it
needed no quotes.
Nick
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Nikos Drandakis Guest



Reply With Quote

