title: I want to retrieve the day of half year in sql server
body: <p>If I want day of year I am using <code>Select datepart(dayofyear , getdate())</code>. </p>
  
  <p>This query will return the day of year of the system date. So the value will be between 1 to 365/366. Now I want to return the day of half-year. Let us suppose we have 12 months and we divide it into 2 parts so it will be Jan to Jun and July to Dec. Now if my system date is 1st july it should return 1 because 1st july is the starting day of the half year. Please help me in solving this issue.</p>