Date Problem

F

F@yy@Z

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
 
F

F@yy@Z

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
 
A

Aaron [SQL Server MVP]

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

F@yy@Z

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
 
F

F@yy@Z

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,159
Messages
2,570,879
Members
47,414
Latest member
GayleWedel

Latest Threads

Top