Subject | Error with TIMESTAMP field |
---|---|
Author | William Gonzáles S. |
Post date | 2005-11-16T18:10:47Z |
Hello, the following query:
SELECT WORK_DATE FROM OBJECTS_IN_WORK
WHERE ((WORK_DATE >= '20050912') AND (WORK_DATE <
'20050914'))
(WORK_DATE is a TIMESTAMP field) it gives the error:
Overflow occurred during data type conversion.
Conversion error from string 20050914
But I have another and more complex query with date
comparison (using the same table, the same field and
the same condition) and works fine, it is:
SELECT OBJECTS_IN_WORK.OBJECT_ID,
OBJECTS_IN_WORK.WORK_DATE,
GROUPS_AND_OWNERS.MAIN_GROUP_ID
FROM OBJECTS_IN_WORK, DOCUMENTS, GROUPS_AND_OWNERS
WHERE (OBJECTS_IN_WORK.OBJECT_ID = DOCUMENTS.DOC_ID)
AND (DOCUMENTS.ORG_ACTIVE = 1)
AND (OBJECTS_IN_WORK.RESPONSIBLE_ID =
'107051115153331022')
AND ((OBJECTS_IN_WORK.WORK_DATE >= '20050912')AND
(OBJECTS_IN_WORK.WORK_DATE < '20050914'))
AND (DOCUMENTS.GROUP_ID = GROUPS_AND_OWNERS.GROUP_ID)
What could be the problem?
Thanks in advance,
William GS
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
SELECT WORK_DATE FROM OBJECTS_IN_WORK
WHERE ((WORK_DATE >= '20050912') AND (WORK_DATE <
'20050914'))
(WORK_DATE is a TIMESTAMP field) it gives the error:
Overflow occurred during data type conversion.
Conversion error from string 20050914
But I have another and more complex query with date
comparison (using the same table, the same field and
the same condition) and works fine, it is:
SELECT OBJECTS_IN_WORK.OBJECT_ID,
OBJECTS_IN_WORK.WORK_DATE,
GROUPS_AND_OWNERS.MAIN_GROUP_ID
FROM OBJECTS_IN_WORK, DOCUMENTS, GROUPS_AND_OWNERS
WHERE (OBJECTS_IN_WORK.OBJECT_ID = DOCUMENTS.DOC_ID)
AND (DOCUMENTS.ORG_ACTIVE = 1)
AND (OBJECTS_IN_WORK.RESPONSIBLE_ID =
'107051115153331022')
AND ((OBJECTS_IN_WORK.WORK_DATE >= '20050912')AND
(OBJECTS_IN_WORK.WORK_DATE < '20050914'))
AND (DOCUMENTS.GROUP_ID = GROUPS_AND_OWNERS.GROUP_ID)
What could be the problem?
Thanks in advance,
William GS
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com