Mukesh Kumar Tiwari

Mukesh Kumar Tiwari

  • NA
  • 980
  • 251.6k

Hot to convert this sql query in linq.

Jul 21 2016 5:29 AM
hi guys,
 
Please help me out from this. i stuck at this  query, i tried but not able to convert in linq. please help. Thanks.
 
select * from (select dl_master.deal_id as `Deal #`, dl_master.deal_name as `Name`,
 
str_to_date(if(dlStart.dlCon_Field is null, '01/01/1900 12:00:00 AM', dlStart.dlCon_Value),'%c/%e/%Y %r') as `Start`,
 
str_to_date(if(dlEnd.dlCon_Field is null, '01/01/9998 12:00:00 AM', dlEnd.dlCon_Value),'%c/%e/%Y %r') as `End`
 
from dl_master Left Join dl_condition dlStart ON dlStart.deal_id = dl_master.deal_id
and dlstart.dlCon_Field = 'Start Date'
Left Join dl_condition dlEnd ON dlEnd.deal_id = dl_master.deal_id and dlEnd.dlCon_Field = 'End Date'
where dl_master.flgDisabled=0) as t Where `start`<=now() AND (`end`>=now() or `end` is null)

Answers (2)