December 29, 2010 at 11:08 am
select ENTRY_DATE from CIRC.SUBS_TAG where ENTRY_DATE <> '10/27/2010'
I get "ORA-01843: not a valid month" error. ENTRY_DATE is date type. Why do i get this error. Please help me .Thank you.
December 29, 2010 at 11:17 am
varunkum (12/29/2010)
select ENTRY_DATE from CIRC.SUBS_TAG where ENTRY_DATE <> '10/27/2010'I get "ORA-01843: not a valid month" error. ENTRY_DATE is date type. Why do i get this error. Please help me .Thank you.
Can you run
exec SP_help [CIRC.SUBS_TAG]
and can you get the datatypes for each column
what is the excat error you are getting have here with error code also
like Msg:12345 .....
Thanks
Parthi
Thanks
Parthi
December 29, 2010 at 11:18 am
Given the complexities of date data, I always do an explicit convert to a specific type, then do my compare - so with your example, I would say:
select ENTRY_DATEfrom CIRC.SUBS_TAG
where convert(varchar(10),ENTRY_DATE,101) <> '10/27/2010'
I'd also check my data to make absolutely sure that there are indeed rows meeting your criterion.
My .03 -- Donna B
December 29, 2010 at 11:20 am
verify the format of date it is displaying (10-27-2010)
December 29, 2010 at 11:20 am
From that error message it looks like you are using Oracle and this is a SQL Server group. Either way changing to an unambiguous date format such as yyyymmdd will probably resolve it.
Mike
December 29, 2010 at 11:21 am
CREATE TABLE SUBS_TAG
(
ACCOUNT NUMBER(12) NOT NULL,
CODE VARCHAR2(2 BYTE) NOT NULL,
ENTRY_DATE DATE,
USERID_ENTRY VARCHAR2(10 BYTE),
USERID_LAST_WRITE VARCHAR2(10 BYTE),
SERVICE_TIME_OVERRIDE NUMBER(3),
TRANS_NUM NUMBER(12),
VALID_FROM DATE DEFAULT TO_DATE('01/01/1500','mm/dd/yyyy') NOT NULL,
VALID_UNTIL DATE DEFAULT TO_DATE('12/31/2999','mm/dd/yyyy') NOT NULL,
BEGIN_DATE DATE,
END_DATE DATE
)
Error is "ORA-01843: not a valid month".
December 29, 2010 at 11:26 am
varunkum (12/29/2010)
CREATE TABLE SUBS_TAG(
ACCOUNT NUMBER(12) NOT NULL,
CODE VARCHAR2(2 BYTE) NOT NULL,
ENTRY_DATE DATE,
USERID_ENTRY VARCHAR2(10 BYTE),
USERID_LAST_WRITE VARCHAR2(10 BYTE),
SERVICE_TIME_OVERRIDE NUMBER(3),
TRANS_NUM NUMBER(12),
VALID_FROM DATE DEFAULT TO_DATE('01/01/1500','mm/dd/yyyy') NOT NULL,
VALID_UNTIL DATE DEFAULT TO_DATE('12/31/2999','mm/dd/yyyy') NOT NULL,
BEGIN_DATE DATE,
END_DATE DATE
)
Error is "ORA-01843: not a valid month".
This is a Microsoft SQL Server forum, and you're using Oracle. May I suggest you post this in an Oracle forum (eg http://www.dbforums.com) as the majority of people here are not going to be familiar with Oracle
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply