<div id="sidebar">
<h3>Newsletter Archive</h3>
<ul class="nav_sidebar">
{exp:query sql="SELECT
DISTINCT YEAR(FROM_UNIXTIME(`entry_date`)) AS `year`
FROM `exp_weblog_titles`
ORDER BY `year` DESC"
WHERE `weblog_id` in (5) 
}

<li><a href="{path=secure/newsletters}{year}" {if "{segment_3}" == "{year}"}{if segment_4 == ""}id="current"{if:else}id="current2"{/if}{/if}>{year} Newsletters</a></li>

{if segment_3 == {year}}

<ul class="sidebar-subnav">
{exp:weblog:entries weblog="newsletters" dynamic="off" disable="trackbacks|pagination|member_data" year="{segment_3}"}
<li><a href="{path=secure/newsletters}{year}/{url_title}" {if "{segment_4}" == "{url_title}"}id="current"{/if}>{title}</a></li>
{/exp:weblog:entries}
</ul>

{/if}

{/exp:query} 
</ul>


</div>