Make a constraint with things like TRUNC

Hello
I want to make an unique constraint on three columns, but one of them is of DATE type. I want only to use the day, month and year information, like this
CONSTRAINT UNIQUE (TRUNC(payday), merchant_code, costumer_code)
but it only works like this:
CONSTRAINT UNIQUE (payday, merchant_code, costumer_code)
How can I do this? Thank's a lot

-- i used the trunc at insert statemetn..works fine
create table po
(id number unique,
name number unique,
da date unique);
insert into po values (&id,&name,trunc(sysdate));

Similar Messages

Maybe you are looking for