hi friends i am trying to insert some values with date and time to Oracle db.
and the ASP code is as follows
sqlinsert="INSERT INTO Tbl_RequestInfo (" &_
"ReqHouseno, " &_
"ReqBadgeno, " &_
"ReqRschedDate, " &_
"ReqCompletiondateest," &_
"ReqJobServices, " &_
"ReqStatus, " &_
"ReqCalldate, " &_
"ReqScheduleddate)values
values (" &_
STR_Quote2(ReplaceQuote(textHouseNo)) & ", " &_
STR_Quote2(ReplaceQuote(textBadgeNo)) & ", " &_
DateDelimiter(FormatDateTime(sdate,2)) & ", " &_
STR_Quote2(ReplaceQuote(textcompletiondateest)) & ", " &_
STR_Quote2(ReplaceQuote("Pending")) & ", " &_
STR_Quote2(ReplaceQuote(session("calldate"))) & ", " &_
DateDelimiter(FormatDateTime(Now())) & ", " &_
DateDelimiter(FormatDateTime(Now())) & ")
MMToConn.execute sqlinsert, recordaffected, 1
and i am getting values as follows
INSERT INTO Tbl_RequestInfo (ReqHouseno, ReqBadgeno, ReqRschedDate, ReqCompletiondateest,ReqJobServices, ReqStatus, ReqCalldate, ReqScheduleddate) values ('smmn725', '216322', '4/1/2008', '4/1/2008 3:59:00 PM', 'Pending', '4/1/2008 10:14:11 AM', '4/1/2008 10:14:11 AM', '4/1/2008 10:14:11 AM') and error as not a valid month
can any one tell whts the problem?
thx
1 1536
Hi,
For inserting Date value into the table using Oracle database you should first convert the date value using To_Date function. This is the syntax for doing the conversion to Date :
TO_DATE(strdate)
e.g. In order to remove the error you have to write it like this : -
sqlinsert="INSERT INTO Tbl_RequestInfo (" &_
-
"ReqHouseno, " &_
-
"ReqBadgeno, " &_
-
"ReqRschedDate, " &_
-
"ReqCompletiondateest," &_
-
"ReqJobServices, " &_
-
"ReqStatus, " &_
-
"ReqCalldate, " &_
-
"ReqScheduleddate)values
-
values (" &_
-
STR_Quote2(ReplaceQuote(textHouseNo)) & ", " &_
-
STR_Quote2(ReplaceQuote(textBadgeNo)) & ", " &_
-
DateDelimiter(FormatDateTime(sdate,2)) & ", " &_
-
STR_Quote2(ReplaceQuote(textcompletiondateest)) & ", " &_
-
STR_Quote2(ReplaceQuote("Pending")) & ", " &_
-
STR_Quote2(ReplaceQuote(session("calldate"))) & ", " &_
-
DateDelimiter(To_Date(FormatDateTime(Now()))) & ", " &_
-
DateDelimiter(TO_Date(FormatDateTime(Now()))) & ")
hi friends i am trying to insert some values with date and time to Oracle db.
and the ASP code is as follows
sqlinsert="INSERT INTO Tbl_RequestInfo (" &_
"ReqHouseno, " &_
"ReqBadgeno, " &_
"ReqRschedDate, " &_
"ReqCompletiondateest," &_
"ReqJobServices, " &_
"ReqStatus, " &_
"ReqCalldate, " &_
"ReqScheduleddate)values
values (" &_
STR_Quote2(ReplaceQuote(textHouseNo)) & ", " &_
STR_Quote2(ReplaceQuote(textBadgeNo)) & ", " &_
DateDelimiter(FormatDateTime(sdate,2)) & ", " &_
STR_Quote2(ReplaceQuote(textcompletiondateest)) & ", " &_
STR_Quote2(ReplaceQuote("Pending")) & ", " &_
STR_Quote2(ReplaceQuote(session("calldate"))) & ", " &_
DateDelimiter(FormatDateTime(Now())) & ", " &_
DateDelimiter(FormatDateTime(Now())) & ")
MMToConn.execute sqlinsert, recordaffected, 1
and i am getting values as follows
INSERT INTO Tbl_RequestInfo (ReqHouseno, ReqBadgeno, ReqRschedDate, ReqCompletiondateest,ReqJobServices, ReqStatus, ReqCalldate, ReqScheduleddate) values ('smmn725', '216322', '4/1/2008', '4/1/2008 3:59:00 PM', 'Pending', '4/1/2008 10:14:11 AM', '4/1/2008 10:14:11 AM', '4/1/2008 10:14:11 AM') and error as not a valid month
can any one tell whts the problem?
thx
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Stefan Bauer |
last post by:
Hi NG,
are this actually valid expressions for DB2 v 7.2?
SELECT TABLE.ATTR1
FROM TABLE
WHERE
CURRENT DATE - 1 MONTH <= LAST_DAY(TABLE.ATTR2)
and
|
by: Finlay |
last post by:
Hi Group
I am designing a report that should show a meter reading for each
month and the previous meter reading for the previous month. The
months are text stored in a field tMonth.
The...
|
by: William Stacey [MVP] |
last post by:
Given a day of the month (<=31) how to calculate if that day is valid for
all months up to some end date or DateTime.MaxValue? TIA
--
William Stacey, MVP
|
by: Ante Perkovic |
last post by:
Hi,
How to declare datetime object and set it to my birthday, first or
last day of this month or any other date.
I can't find any examples in VS.NET help!
BTW, what is the difference...
|
by: dba123 |
last post by:
Why am I getting this error for Budget?
Error: An exception of type 'System.FormatException' occurred in
mscorlib.dll but was not handled in user code
Additional information: String was not...
|
by: Petyr David |
last post by:
Just looking for the simplest. right now my perl script returns an
error messge to the user if the date string is invalid. would like to
do this before accessing the server.
TX
|
by: User |
last post by:
Hi,
Assuming the date format is in 31-Feb-2006
<head>
<script language="javascript">
function t()
{
mill=new Date(2006, 01, 31) ;
|
by: deep2389 |
last post by:
Hi,
I need to run a stored procedure which accepts date as an input. If I input date say 11252000 (MMDDYYYY), it is accepting but for dates such as 03062000, it is throwing error "ORA-01843:...
|
by: user1980 |
last post by:
Hello there
Can somebody help me with this.
I have a form where the user enters his date of birth from 2 drop downs and a textbox. Month and date are dropdowns and year is to be entered in a text...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |