Adrian Reszka

Adrian Reszka

  • NA
  • 76
  • 694

How to write a linq query to match this sql one ... ?

May 17 2016 3:15 AM
Hi,
 
Can someone help me out with writing a linq querry to match this sql one ?
 
  1. SELECT   
  2.         [PID_unique_ID],  
  3.       min(AllocationStart) as 'start',  
  4.       max(AllocationStart) as 'end'  
  5.       ,GETDATE() AS CurrentDateTime   
  6.         
  7.   FROM [table].[dbo].[table_name]  
  8.     Where table_name.AllocationStart BETWEEN DATEADD(ww,-2,GETDATE()) AND DATEADD(ww,4,GETDATE())  
  9.    
  10.   Group by [PID_unique_ID]  

Answers (2)