|
|
Working with Dates in Oracle [message #248461 is a reply to message #248446] |
Fri, 29 June 2007 02:14 |
nadeemraza092
Messages: 14 Registered: June 2007 Location: Pakistan
|
Junior Member |
|
|
SQL> desc attendance;
Name Null? Type
------------------------------- -------- ----
REC_ID NOT NULL VARCHAR2(5)
EMP_ID VARCHAR2(7)
ENTERY_DATE DATE
GATE_TIME_IN DATE
GATE_TIME_OUT DATE
TIME_IN DATE
TIME_OUT DATE
ENT_DATE DATE
IP_ADDRESS VARCHAR2(15)
OS_USER VARCHAR2(15)
OS_TERM VARCHAR2(15)
USERID VARCHAR2(15) Sir this is My Table Structure and In Time_in and Time_out Column I have stored Time also but in the Entrery_date column Only Date is Stored
[Updated on: Fri, 29 June 2007 04:55] Report message to a moderator
|
|
|
|
|
Re: Working with Dates in Oracle [message #248508 is a reply to message #248487] |
Fri, 29 June 2007 04:47 |
nadeemraza092
Messages: 14 Registered: June 2007 Location: Pakistan
|
Junior Member |
|
|
Dear Sir;
Please check this query which I used to Update the Date in the Time_out column
UPDATE ATTENDANCE
SET TIME_OUT = TO_DATE(TO_CHAR(ENTERY_DATE,'DD-MON-RRRR'))||' '||TO_CHAR(TIME_OUT,'HH24.MI')
WHERE EMP_ID='3190017'
AND ENTERY_DATE BETWEEN '01-APR-07' AND '30-APR-07'
It returns following error message.
ORA-01843: not a valid month
Now I think you will understand what I want to do. Please see the table structure before reading this query. Infact I want that the Column Time_out should updated by the date feeded in Column Entery_date and Time whcih is feeded in the Time_out Column remains the same.
Nadeem
[Updated on: Fri, 29 June 2007 04:52] Report message to a moderator
|
|
|
|
|
|
Re: Working with Dates in Oracle [message #248528 is a reply to message #248525] |
Fri, 29 June 2007 07:01 |
nadeemraza092
Messages: 14 Registered: June 2007 Location: Pakistan
|
Junior Member |
|
|
Sir I have Tried it as
UPDATE ATTENDANCE
SET TIME_OUT = TO_DATE('DD-MON-RRRRHH24.MISS',TO_CHAR(ENTERY_DATE,'DD-MON-RRRR')||TO_CHAR(TIME_OUT,'HH24.MI'))
WHERE EMP_ID='3190017'
AND TO_DATE(ENTERY_DATE) BETWEEN '01-APR-07' AND '30-APR-07'
But Now It Returns
ERROR at line 2:
ORA-01821: date format not recognized
Sir please Help Me out
Nadeem
[Updated on: Fri, 29 June 2007 07:03] Report message to a moderator
|
|
|
|
|
|
|
Re: Working with Dates in Oracle [message #248535 is a reply to message #248533] |
Fri, 29 June 2007 07:41 |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
nadeemraza092 wrote on Fri, 29 June 2007 08:31 | Sir Its Top Urgent Please Solve My Problem this time
|
The word urgent will cause more sarcastic remarks, more people to ignore future posts by you and keep you running around in circles. We don't care if you have an urgent matter. If it's so urgent, pay a consultant $200 per hour to solve it for you.
|
|
|
|