title: Convert a Date to Julian Date and then Store in a Numeric Field in SQL Server 2005
body: <p>I have a date field in a T-SQL variable which I want to convert to Julian Date Format and then insert in to a <code>Numeric</code> column in a table. Can someone please help?</p>
  
  <p>I saw there are some posts on Julian Date but I am not able to get through.</p>
  
  <p>EX : </p>
  
  <pre><code>declare @d datetime 
  Set @d = GetDate()
  select datediff(d, 0, @d) + 693596
  </code></pre>
  
  <p>The above statement does convert in to a julian date but not in the correct format. For example if today is 15 Feb 2014 then this should convert this in to 114046 but it converts this to 735279.</p>
  
  <p>Also once this gets converted to correct julian format. I want to convert this to Numeric as I want to insert to a <code>numeric</code> column in a table.</p>
  
  <p>I am sorry if this question has been asked previously. I am new to SQL Server 2005.</p>
  
  <p>Any help will be appreciated</p>
  
  <p>Regards</p>