|
 |
asp_web_howto thread: FORMAT Date
Message #1 by "Franco" <francO.perretta@c...> on Thu, 21 Dec 2000 15:26:27 -0000
|
|
Hi Dears,
I have a problem with the date format. The Field "InDate" is declared
as -DateTime Lengt 8- in SQL Table.
Why give me this error when I execute?
Microsoft OLE DB Provider for SQL Server error '80040e07'
Operand type clash: int is incompatible with datetime
Again thank you for your patience.
Franco
--------------------------------------------------
TempMatricule =Request("MatInput")
TempDateSheet = Request( "DateInput")
TempDateSheet=FormatDateTime(TempDateSheet,VBShortdate)
qd = "INSERT INTO Test (Uno,InDate) VALUES ("& TempMatricule & "," &
TempDateSheet & ")"
Set Rs=MyConn.Execute(qd)
------------------------------------------------
---
MaximumASP offers enhanced hosting solutions on the Windows 2000 platform. Dedicated processor, RAM, and server resources provide
dedicated server performance at virtual server prices. Commercial components provided; custom components allowed.
---
You are currently subscribed to asp_web_howto as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_web_howto-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #2 by "Morgan, Rob" <Rob.Morgan@o...> on Thu, 21 Dec 2000 10:47:27 -0500
|
|
Datetime datatype should be treated like a character datatype. Try using
single quotes around the TempDateSheet var.
qd = "INSERT INTO Test (Uno,InDate) VALUES ("& TempMatricule & ",'" &
TempDateSheet & "')"
-----Original Message-----
From: Franco [mailto:francO.perretta@c...]
Sent: Thursday, December 21, 2000 10:26 AM
To: ASP Web HowTo
Subject: [asp_web_howto] FORMAT Date
Hi Dears,
I have a problem with the date format. The Field "InDate" is declared
as -DateTime Lengt 8- in SQL Table.
Why give me this error when I execute?
Microsoft OLE DB Provider for SQL Server error '80040e07'
Operand type clash: int is incompatible with datetime
Again thank you for your patience.
Franco
--------------------------------------------------
---
MaximumASP offers enhanced hosting solutions on the Windows 2000 platform. Dedicated processor, RAM, and server resources provide
dedicated server performance at virtual server prices. Commercial components provided; custom components allowed.
---
You are currently subscribed to asp_web_howto as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_web_howto-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #3 by Gregory_Griffiths@c... on Thu, 21 Dec 2000 16:31:29 +0000
|
|
You may also need to provide some sort of Format instruction to the
database e.g.
to_date('12/12/2000','dd/mm/yyyy')
works for Oracle
> -----Original Message-----
> From: Rob.Morgan@o... [mailto:Rob.Morgan@o...]
> Sent: 21 December 2000 15:47
> To: asp_web_howto@p...
> Cc: Rob.Morgan@o...
> Subject: [asp_web_howto] RE: FORMAT Date
>
>
> Datetime datatype should be treated like a character
> datatype. Try using
> single quotes around the TempDateSheet var.
>
> qd = "INSERT INTO Test (Uno,InDate) VALUES ("& TempMatricule & ",'" &
> TempDateSheet & "')"
>
> -----Original Message-----
> From: Franco [mailto:francO.perretta@c...]
> Sent: Thursday, December 21, 2000 10:26 AM
> To: ASP Web HowTo
> Subject: [asp_web_howto] FORMAT Date
>
>
> Hi Dears,
> I have a problem with the date format. The Field "InDate"
> is declared
> as -DateTime Lengt 8- in SQL Table.
> Why give me this error when I execute?
>
> Microsoft OLE DB Provider for SQL Server error '80040e07'
> Operand type clash: int is incompatible with datetime
>
> Again thank you for your patience.
> Franco
>
> --------------------------------------------------
>
>
---
MaximumASP offers enhanced hosting solutions on the Windows 2000 platform. Dedicated processor, RAM, and server resources provide
dedicated server performance at virtual server prices. Commercial components provided; custom components allowed.
---
You are currently subscribed to asp_web_howto as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_web_howto-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #4 by PERRETTA Franco <Franco.PERRETTA@c...> on Fri, 22 Dec 2000 11:10:01 +0100
|
|
Dears,
It is incredible but your suggestion does not work the error is:
Microsoft OLE DB Provider for SQL Server error '80040e07'
The conversion of CHAR to DATETIME resulted in a DATETIME value out of range
Thank you
Franco
___________________________________
Perretta Franco
Council of Europe
Department of Information Technology
Information Access Unit
67075 Strasbourg Cedex
tel: +33 (0)3 88 41 22 18 fax: +33 (0)3 88 41 27 39
mailto:franco.perretta@c...
http://www.coe.int
-----Original Message-----
From: Morgan, Rob [mailto:Rob.Morgan@o...]
Sent: Thursday 21 December 2000 16:47
To: ASP Web HowTo
Subject: [asp_web_howto] RE: FORMAT Date
Datetime datatype should be treated like a character datatype. Try using
single quotes around the TempDateSheet var.
qd = "INSERT INTO Test (Uno,InDate) VALUES ("& TempMatricule & ",'" &
TempDateSheet & "')"
-----Original Message-----
From: Franco [mailto:francO.perretta@c...]
Sent: Thursday, December 21, 2000 10:26 AM
To: ASP Web HowTo
Subject: [asp_web_howto] FORMAT Date
Hi Dears,
I have a problem with the date format. The Field "InDate" is declared
as -DateTime Lengt 8- in SQL Table.
Why give me this error when I execute?
Microsoft OLE DB Provider for SQL Server error '80040e07'
Operand type clash: int is incompatible with datetime
Again thank you for your patience.
Franco
---
MaximumASP offers enhanced hosting solutions on the Windows 2000 platform. Dedicated processor, RAM, and server resources provide
dedicated server performance at virtual server prices. Commercial components provided; custom components allowed.
---
You are currently subscribed to asp_web_howto as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_web_howto-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #5 by "Morgan, Rob" <Rob.Morgan@o...> on Fri, 22 Dec 2000 07:02:34 -0500
|
|
I suppect from the "DATETIME value out of range" that the format of the date
you are trying to feed it is not a valid input date format.
Try using the isdate function on the var to validate the date against the
web server. Then reformat the date using the datepart functions to a format
that the database will accept. Don't forget to format the time part of the
date if it's needed.
IsDate Function
Returns a Boolean value indicating whether an expression can be converted to
a date.
IsDate(expression)
DatePart Function
Returns the specified part of a given date.
DatePart(interval, date[, firstdayofweek[, firstweekofyear]])
-----Original Message-----
From: PERRETTA Franco [mailto:Franco.PERRETTA@c...]
Sent: Friday, December 22, 2000 5:10 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: FORMAT Date
Dears,
It is incredible but your suggestion does not work the error is:
Microsoft OLE DB Provider for SQL Server error '80040e07'
The conversion of CHAR to DATETIME resulted in a DATETIME value out of range
Thank you
Franco
___________________________________
Perretta Franco
Council of Europe
Department of Information Technology
Information Access Unit
67075 Strasbourg Cedex
tel: +33 (0)3 88 41 22 18 fax: +33 (0)3 88 41 27 39
mailto:franco.perretta@c...
http://www.coe.int
-----Original Message-----
From: Morgan, Rob [mailto:Rob.Morgan@o...]
Sent: Thursday 21 December 2000 16:47
To: ASP Web HowTo
Subject: [asp_web_howto] RE: FORMAT Date
Datetime datatype should be treated like a character datatype. Try using
single quotes around the TempDateSheet var.
qd = "INSERT INTO Test (Uno,InDate) VALUES ("& TempMatricule & ",'" &
TempDateSheet & "')"
-----Original Message-----
From: Franco [mailto:francO.perretta@c...]
Sent: Thursday, December 21, 2000 10:26 AM
To: ASP Web HowTo
Subject: [asp_web_howto] FORMAT Date
Hi Dears,
I have a problem with the date format. The Field "InDate" is declared
as -DateTime Lengt 8- in SQL Table.
Why give me this error when I execute?
Microsoft OLE DB Provider for SQL Server error '80040e07'
Operand type clash: int is incompatible with datetime
Again thank you for your patience.
Franco
---
MaximumASP offers enhanced hosting solutions on the Windows 2000 platform. Dedicated processor, RAM, and server resources provide
dedicated server performance at virtual server prices. Commercial components provided; custom components allowed.
---
You are currently subscribed to asp_web_howto as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_web_howto-$subst('Recip.MemberIDChar')@p2p.wrox.com
|
|
 |