2
Answers

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

Adrian Reszka

Adrian Reszka

8y
377
1
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)