Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 02:18 PM
F@yy@Z
Guest
 
Posts: n/a
Default Date Problem

Hi

I have one field in SQL Database datatype as datetime. When I am inserting
or updating using asp on my machine its working fine but when I installed DB
and application on other server and try to insert or update date using asp
it giving error of date convertion.

I know that its date format problem on one server it accept only
"24/07/2004" format but on second server it accept as "07/24/2004" .

As I don't know what will be date format on client server so this will be a
problem.

I am sure some of you have faced this problem and solved this, Please advise
me how I can solve it what is the best way.

Kind Regards




  #2  
Old July 19th, 2005, 02:18 PM
John
Guest
 
Posts: n/a
Default Re: Date Problem

http://www.aspfaq.com/show.asp?id=2023


  #3  
Old July 19th, 2005, 02:18 PM
John
Guest
 
Posts: n/a
Default Re: Date Problem

Use different boxes for D, M and Y
see ex. on http://www.tenerife-dolphins-whales.com/booking.asp


  #4  
Old July 19th, 2005, 02:18 PM
F@yy@Z
Guest
 
Posts: n/a
Default Re: Date Problem

Thanks for your reply
I tried the method described on http://www.aspfaq.com/show.asp?id=2023 link
It giving me error when I am using date as "20040724" but there is no error
when using "2004-07-24".

As I am using only SQL server it should work according to this article
inserting date as "20040724" but its not.

its giving following error

"Microsoft OLE DB Provider for SQL Server (0x80040E07)
The conversion of a char data type to a datetime data type resulted in an
out-of-range datetime value."


I tried

"John" <n o b o d y@spam.com> wrote in message
news:LPbLc.190094$xB.9264239@phobos.telenet-ops.be...[color=blue]
> Use different boxes for D, M and Y
> see ex. on http://www.tenerife-dolphins-whales.com/booking.asp
>
>[/color]


  #5  
Old July 19th, 2005, 02:18 PM
Aaron [SQL Server MVP]
Guest
 
Posts: n/a
Default Re: Date Problem

Can you show the actual statement that causes this error, and the structure
of the table you are inserting into...

--
http://www.aspfaq.com/
(Reverse address to reply.)




"F@yy@Z" <fayyaz.ahmed@mvwebmaker.com> wrote in message
news:#M7OhwnbEHA.4032@TK2MSFTNGP11.phx.gbl...[color=blue]
> Thanks for your reply
> I tried the method described on http://www.aspfaq.com/show.asp?id=2023[/color]
link[color=blue]
> It giving me error when I am using date as "20040724" but there is no[/color]
error[color=blue]
> when using "2004-07-24".
>
> As I am using only SQL server it should work according to this article
> inserting date as "20040724" but its not.
>
> its giving following error
>
> "Microsoft OLE DB Provider for SQL Server (0x80040E07)
> The conversion of a char data type to a datetime data type resulted in an
> out-of-range datetime value."
>
>
> I tried
>
> "John" <n o b o d y@spam.com> wrote in message
> news:LPbLc.190094$xB.9264239@phobos.telenet-ops.be...[color=green]
> > Use different boxes for D, M and Y
> > see ex. on http://www.tenerife-dolphins-whales.com/booking.asp
> >
> >[/color]
>
>[/color]


  #6  
Old July 19th, 2005, 02:18 PM
F@yy@Z
Guest
 
Posts: n/a
Default Re: Date Problem

Here is sql and Table format

INSERT INTO Semester (Semester_Name, Semester_Start, Semester_End,
Course_id)VALUES ('test','20042007','20042207','asdsa')


3 Semester_ID numeric 9 0
0 Semester_Name nvarchar 30 0
0 Semester_Start datetime 8 0
0 Semester_End datetime 8 0
0 Course_id nvarchar 10 1

Regards




"Aaron [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:O3mocynbEHA.3752@TK2MSFTNGP12.phx.gbl...[color=blue]
> Can you show the actual statement that causes this error, and the[/color]
structure[color=blue]
> of the table you are inserting into...
>
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
>
>
> "F@yy@Z" <fayyaz.ahmed@mvwebmaker.com> wrote in message
> news:#M7OhwnbEHA.4032@TK2MSFTNGP11.phx.gbl...[color=green]
> > Thanks for your reply
> > I tried the method described on http://www.aspfaq.com/show.asp?id=2023[/color]
> link[color=green]
> > It giving me error when I am using date as "20040724" but there is no[/color]
> error[color=green]
> > when using "2004-07-24".
> >
> > As I am using only SQL server it should work according to this article
> > inserting date as "20040724" but its not.
> >
> > its giving following error
> >
> > "Microsoft OLE DB Provider for SQL Server (0x80040E07)
> > The conversion of a char data type to a datetime data type resulted in[/color][/color]
an[color=blue][color=green]
> > out-of-range datetime value."
> >
> >
> > I tried
> >
> > "John" <n o b o d y@spam.com> wrote in message
> > news:LPbLc.190094$xB.9264239@phobos.telenet-ops.be...[color=darkred]
> > > Use different boxes for D, M and Y
> > > see ex. on http://www.tenerife-dolphins-whales.com/booking.asp
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


  #7  
Old July 19th, 2005, 02:18 PM
F@yy@Z
Guest
 
Posts: n/a
Default Re: Date Problem

Sorry I relize the mistake

INSERT INTO Semester (Semester_Name, Semester_Start, Semester_End,
Course_id)VALUES ('test','20042007','20042207','asdsa')

it should like "20040720"

Soryy about this again



"Aaron [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:O3mocynbEHA.3752@TK2MSFTNGP12.phx.gbl...[color=blue]
> Can you show the actual statement that causes this error, and the[/color]
structure[color=blue]
> of the table you are inserting into...
>
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
>
>
> "F@yy@Z" <fayyaz.ahmed@mvwebmaker.com> wrote in message
> news:#M7OhwnbEHA.4032@TK2MSFTNGP11.phx.gbl...[color=green]
> > Thanks for your reply
> > I tried the method described on http://www.aspfaq.com/show.asp?id=2023[/color]
> link[color=green]
> > It giving me error when I am using date as "20040724" but there is no[/color]
> error[color=green]
> > when using "2004-07-24".
> >
> > As I am using only SQL server it should work according to this article
> > inserting date as "20040724" but its not.
> >
> > its giving following error
> >
> > "Microsoft OLE DB Provider for SQL Server (0x80040E07)
> > The conversion of a char data type to a datetime data type resulted in[/color][/color]
an[color=blue][color=green]
> > out-of-range datetime value."
> >
> >
> > I tried
> >
> > "John" <n o b o d y@spam.com> wrote in message
> > news:LPbLc.190094$xB.9264239@phobos.telenet-ops.be...[color=darkred]
> > > Use different boxes for D, M and Y
> > > see ex. on http://www.tenerife-dolphins-whales.com/booking.asp
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


  #8  
Old July 19th, 2005, 02:18 PM
Aaron [SQL Server MVP]
Guest
 
Posts: n/a
Default Re: Date Problem

There is no 20th or 22nd month. You created YYYYDDMM strings, not YYYYMMDD
strings.

--
http://www.aspfaq.com/
(Reverse address to reply.)




"F@yy@Z" <fayyaz.ahmed@mvwebmaker.com> wrote in message
news:OaAC$7nbEHA.4092@TK2MSFTNGP11.phx.gbl...[color=blue]
> Here is sql and Table format
>
> INSERT INTO Semester (Semester_Name, Semester_Start, Semester_End,
> Course_id)VALUES ('test','20042007','20042207','asdsa')
>
>
> 3 Semester_ID numeric 9 0
> 0 Semester_Name nvarchar 30 0
> 0 Semester_Start datetime 8 0
> 0 Semester_End datetime 8 0
> 0 Course_id nvarchar 10 1
>
> Regards
>
>
>
>
> "Aaron [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
> news:O3mocynbEHA.3752@TK2MSFTNGP12.phx.gbl...[color=green]
> > Can you show the actual statement that causes this error, and the[/color]
> structure[color=green]
> > of the table you are inserting into...
> >
> > --
> > http://www.aspfaq.com/
> > (Reverse address to reply.)
> >
> >
> >
> >
> > "F@yy@Z" <fayyaz.ahmed@mvwebmaker.com> wrote in message
> > news:#M7OhwnbEHA.4032@TK2MSFTNGP11.phx.gbl...[color=darkred]
> > > Thanks for your reply
> > > I tried the method described on http://www.aspfaq.com/show.asp?id=2023[/color]
> > link[color=darkred]
> > > It giving me error when I am using date as "20040724" but there is no[/color]
> > error[color=darkred]
> > > when using "2004-07-24".
> > >
> > > As I am using only SQL server it should work according to this article
> > > inserting date as "20040724" but its not.
> > >
> > > its giving following error
> > >
> > > "Microsoft OLE DB Provider for SQL Server (0x80040E07)
> > > The conversion of a char data type to a datetime data type resulted in[/color][/color]
> an[color=green][color=darkred]
> > > out-of-range datetime value."
> > >
> > >
> > > I tried
> > >
> > > "John" <n o b o d y@spam.com> wrote in message
> > > news:LPbLc.190094$xB.9264239@phobos.telenet-ops.be...
> > > > Use different boxes for D, M and Y
> > > > see ex. on http://www.tenerife-dolphins-whales.com/booking.asp
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles