Quote:
quote:Originally posted by Fritz
Hi,
i'm useing two tables:
project.id project.mandant
----------------------------
1 A
2 A
3 B
4 B
attr.id attr.name attr.value
----------------------------
1 DATE 12.01.2005
2 DATE 12.01.2005
3 DATE 12.01.2005 13:45:20
4 DATE 12.01.2005 13:47:20
The following SQL-Statement throw an error (ORA-01830).
select p.project_id, TO_DATE(a.value) AS SDATE
from project p, attr a
where p.mandant = 'A' and a.id = p.id
and a.name = 'DATE'
and TO_DATE(a.value,'DD.MM.YYYY') >= TO_DATE('01.08.2005','DD.MM.YYYY')
How can i make oracle only look at the attr.id = 1 and attr.id = 2 ?
Greeting
Fritz
|
Hi:
Change the line
Code:
TO_DATE(a.value) AS SDATE
to the following:
Code:
TO_DATE(a.value,'DD.MM.YYYY') AS SDATE
The problem is that the TO_DATE function doesn't recognize the data in your field properly... It needs to know which are the months, days, etc.