I think there must be a trick (in SQLserver or ADONET) to do it:

I have created a view with 4 fields. The last field is a calculated field

myView (From a relationship between Table1(T1) and Table2(T2))

T1.Agent T1.Sales T2.Charge Total (Sales-Charge)

Ken 2000 500 1500
Tom 3000 NULL NULL

There is no value (Row) for Tom in the table who has the charge field (T2),
as a consecuence the total is Null because the sustraction can be made.

Is it possible to get this outputs for Tom without adding a record to the
table who has the charge field(T2) ?

Tom 3000 NULL 3000

What is important is to get a real value in the total field.

any sug

ken

Re: SQLServer or ADONET tricky by Grzegorz

Grzegorz
Fri Oct 22 16:51:09 CDT 2004

Użytkownik "Ken" <Ken@discussions.microsoft.com> napisaÅ? w wiadomoÅ?ci
news:5D120850-C577-4D64-AD20-0E64163CBED5@microsoft.com...
>I think there must be a trick (in SQLserver or ADONET) to do it:
>
> I have created a view with 4 fields. The last field is a calculated field
>
> myView (From a relationship between Table1(T1) and Table2(T2))
>
> T1.Agent T1.Sales T2.Charge Total (Sales-Charge)
>
> Ken 2000 500 1500
> Tom 3000 NULL NULL
>
> There is no value (Row) for Tom in the table who has the charge field
> (T2),
> as a consecuence the total is Null because the sustraction can be made.
>
> Is it possible to get this outputs for Tom without adding a record to the
> table who has the charge field(T2) ?
>
> Tom 3000 NULL 3000
>
> What is important is to get a real value in the total field.

Read help about IsNull. There are two function with the same name: first in
SQL Server and in second in ADO.NET calculated columns.

Regards,
Grzegorz