I'm working on a query that will need to do some calculations relating to days of inventory remaining based on current level and year-to-date usage. To do this I need to be able to pull out the current day of year (1 - 365) so that I can use this to help determine days of inventory remaining. What is the best way to do this calculation based on the value retrieved from GetDate? Im using a SQL query to pull the data and calculate all in one step for export to Excel.
Thanks in advance,