473,406 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

not a valid month

12
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
Apr 1 '08 #1
1 1536
shweta123
692 Expert 512MB
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 :

Expand|Select|Wrap|Line Numbers
  1. sqlinsert="INSERT INTO Tbl_RequestInfo (" &_
  2. "ReqHouseno, " &_
  3. "ReqBadgeno, " &_
  4. "ReqRschedDate, " &_
  5. "ReqCompletiondateest," &_
  6. "ReqJobServices, " &_
  7. "ReqStatus, " &_
  8. "ReqCalldate, " &_
  9. "ReqScheduleddate)values
  10. values (" &_
  11. STR_Quote2(ReplaceQuote(textHouseNo)) & ", " &_
  12. STR_Quote2(ReplaceQuote(textBadgeNo)) & ", " &_
  13. DateDelimiter(FormatDateTime(sdate,2)) & ", " &_
  14. STR_Quote2(ReplaceQuote(textcompletiondateest)) & ", " &_
  15. STR_Quote2(ReplaceQuote("Pending")) & ", " &_
  16. STR_Quote2(ReplaceQuote(session("calldate"))) & ", " &_
  17. DateDelimiter(To_Date(FormatDateTime(Now()))) & ", " &_
  18. 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
Apr 1 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
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
1
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...
7
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
6
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...
10
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...
17
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
9
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) ;
4
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:...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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
1
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...
0
marktang
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,...
0
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...
0
Oralloy
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,...
0
tracyyun
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...
0
agi2029
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,...
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.