SQLServer or ADONET tricky

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Użytkownik "Ken said:
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
 
Back
Top