title: Crystal Reports formula for number of workdays between first day of current quarter and currentdate
body: <p>I'm having trouble with this.  If I find an answer I'll include it in my post.
  SQL to calculate number of days in current quarter, for instance. I can't figure it with Crystal Syntax which is where I fall short.</p>
  
  <p>for starters,</p>
  
  <p>SQL to get 1st day of current quarter</p>
  
  <pre><code>SELECT DATEADD(qq, DATEDIFF(qq, 0, GETDATE()), 0)
  </code></pre>
  
  <p>SQL to get last day of current quarter</p>
  
  <pre><code>SELECT DATEADD (dd, -1, DATEADD(qq, DATEDIFF(qq, 0, GETDATE()) +1, 0))
  </code></pre>
  
  <p>update:</p>
  
  <p>beginning of current quarter in Crystal syntax:</p>
  
  <pre><code>dateserial(year(currentdate),datepart('q',currentdate)*3-2,1)
  </code></pre>
  
  <p>end of current quarter</p>
  
  <pre><code>dateserial(year(currentdate),datepart('q',currentdate)*3+1,1-1)
  </code></pre>