I am using `Sql-server 2012`

My table definition is:

```
create table products1(pid int,pnm varchar(10),oid int foreign key references orders1(oid))

create table orders1(oid int primary key,onm varchar(10),odt date)

insert into products1 values(1,'ABC',1),(2,'DEF',2)

insert into orders1 values(1,'QTY','2013-04-27'),(2,'PROD','2015-04-29')

create function dbo.udf_getmaxdt(@a date)
returns date
as
begin
select @a=max(o.odt) from orders1 o inner join products1 p on o.oid=p.pid
return @a
end

create function dbo.udf_getmaxdt(@a date)
returns TABLE 
as
RETURN
(
select @a=max(o.odt) from orders1 o inner join products1 p on o.oid=p.pid
)
end

```

The syntax might be wrong but I am on the task to determine the best of the 2 types of function.

But aint able to tell which one,could you help me on this?

regards,
Chio