title: How can I convert a date field to number in Google Data Studio?
body: <p>In Google Data Studio I'm searching for a formula to transform a date field into a number field.</p>
  <p>I have been trying several options like these but they don't work.</p>
  <pre><code>CAST(Date_field as NUMBER)
  </code></pre>
  <blockquote>
  <p>Invalid formula - Cannot cast from DATE to DOUBLE</p>
  </blockquote>
  <pre><code>Date_field+0
  </code></pre>
  <blockquote>
  <p>Invalid formula - Operator &quot;+&quot; doesn't support DATE + NUMBER. Operator &quot;+&quot; supports NUMBER + NUMBER.</p>
  </blockquote>
  <p><code>datevalue() or value()</code> also don't exist.</p>
  <p>Precision: I'm looking for a solution without changing the original date field in the data source or the connection. Only with a formula.</p>
  <p>The expected result is a continuous series of integer numbers like this (the zero reference point doesn't matter, as long as 2 consecutive days are incremented by 1.)</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: center;">Date_field</th>
  <th style="text-align: center;">Expected_output</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: center;">23 Feb 2022</td>
  <td style="text-align: center;">44,615</td>
  </tr>
  <tr>
  <td style="text-align: center;">22 Feb 2022</td>
  <td style="text-align: center;">44,614</td>
  </tr>
  <tr>
  <td style="text-align: center;">21 Feb 2022</td>
  <td style="text-align: center;">44,613</td>
  </tr>
  <tr>
  <td style="text-align: center;">2 Jan 2022</td>
  <td style="text-align: center;">44,563</td>
  </tr>
  <tr>
  <td style="text-align: center;">1 Jan 2022</td>
  <td style="text-align: center;">44,562</td>
  </tr>
  <tr>
  <td style="text-align: center;">31 Dec 2021</td>
  <td style="text-align: center;">44,561</td>
  </tr>
  <tr>
  <td style="text-align: center;">30 Dec 2021</td>
  <td style="text-align: center;">44,560</td>
  </tr>
  </tbody>
  </table>
  </div>