Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle 9i: comparison of DATEs

Re: Oracle 9i: comparison of DATEs

From: Norman Dunbar <Oracle_at_MSSQLBountifulSolutions.co.uk>
Date: Sun, 24 Aug 2003 22:11:07 +0000
Message-ID: <bib9g4$hqt$2$8302bc10@news.demon.co.uk>


Tijana wrote:

> Why is it that a query which looks like this:
>
> select * from akcizastopa
> where sifra = '777' and datumod = to_date('20.06.2003', 'DD.MM.YYYY')
>
> returns one row, while
>
> update akcizastopa
> set iznos = 5
> where sifra = '777' and datumod = to_date('20.06.2003', 'DD.MM.YYYY')
>
> doesn't update any rows?
>
> Please note that the where clause is identical.
> The contents of the table were also identical at the times I ran the
> queries.
>
> Thanks

Hi Tijana,

try this instead :

update akcizastopa
set iznos = 5
where sifra = '777' and
trunc(datumod) = to_date('20.06.2003', 'DD.MM.YYYY')

If it works then the reason the update failed is due to the time part of the date being considered in the comparison.

If you want to see the time part do this :

select to_char(datumod, 'dd.mm.yyyy hh:mi:ss') from akcizastopa
where sifra = '777'

Cheers,
Norman (Lurking at home :o)

-- 
Remove a certain other database to reply :o)
Received on Sun Aug 24 2003 - 17:11:07 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US