<p>I'm try to extract info from a MySQL DB into a MS SQL DB. The DB is a mess and the developer is no longer available.</p>

<p>All dates are in char fields, and I use </p>

<pre><code>SELECT concat( mid(DueDate, 7, 4), mid(DueDate, 4, 2), mid(DueDate, 1, 2)) as DueDate FROM TableName
</code></pre>

<p>to get the date field in a format so MS sql server can import them.</p>

<p>Now, I want to export only the record with the date greater than today, so the questions are:</p>

<ul>
<li>What is the equivalent of GetDate() in MySQL?</li>
<li>Is there a better way to cast the date to make the comparison?</li>
</ul>

In MySQL you can convert a string to a date using the
STR_TO_DATE
function.
An example usage is:
```
```
mysql> SELECT STR_TO_DATE('04/31/2004', '%m/%d/%Y');
        -> '2004-04-31'
```
```
To get the current date in MySQL simply use the NOW() function. You can then check if a parsed date is later than today using something like
```
```
WHERE STR_TO_DATE('04/31/2009', '%m/%d/%Y') > NOW()
```
```