tri_inn

tri_inn

  • NA
  • 1.2k
  • 233.9k

Nested Select queries i main select query LINQ

Jun 15 2015 3:00 PM

apologized for asking a help for linq query. i hardly use LINQ rather i use MSDAAB as DAL which i use to execute my inline sql query or my db store procedure etc. now i am in situation where i need to use LINQ to extract data from datatable.

here i am attaching one screenshot like how my data look like enter image description here

the is data is coming from sql server and for which i am using the below query for sql server. please see my query first.

select (select count(*) as incoming from tridip_Interval where direction='I'  and CONVERT(datetime,right([Call Start],8)) >='08:30:00'  and CONVERT(datetime,right([Call Start],8)) <='09:00:00'  and Is_Internal=0 and continuation=0 and  RIGHT(convert(varchar,[call duration]),8)<> '00:00:00'  and party1name='Train5') as incoming, (select count(*) as OutGoing from tridip_Interval where direction='O'  and CONVERT(datetime,right([Call Start],8)) >='08:30:00'  and CONVERT(datetime,right([Call Start],8)) <='09:00:00'  and Is_Internal=0 and continuation=0   and party1name not in ('Voice Mail')  and party1name='Train5') as OutGoing, (select count(*) as CallTransfer from tridip_Interval where continuation=1   and CONVERT(datetime,right([Call Start],8)) >='08:30:00'  and CONVERT(datetime,right([Call Start],8)) <='09:00:00'  and RIGHT(convert(varchar,[call duration]),8)<> '00:00:00' and  party1name not in ('Voice Mail')  and party1name='Train5') as CallTransfer, (SELECT count(*) as UnansweredCalls_DuringBusinessHours from tridip_Interval where direction='I' and  CONVERT(datetime,right([Call Start],8)) >='08:30:00'  and CONVERT(datetime,right([Call Start],8)) <='09:00:00'  and RIGHT(convert(varchar,[call duration]),8)= '00:00:00'  and [Ring duration]>0 and party1name='Train5') as misscall

now i want to use LINQ to query data table but hence i am not good in linq so not being able to compose the above sql like query with linq. so just wonder if any guy help me to compose the above query with linq.

apologized could not highlight my linq query because very honestly i know linq little and that is the reason things is not coming to my mind how to compose the same above sql query with LINQ. looking for hep and support.


Answers (3)