title: How to compare dates in a sql script to progress database?
body: <p>We have a field in our progress database which is DATETIME-TZ so an example of the data is "23/05/2019 12:11:16.099" -  I'm need some help to compare dates in this field with an SQL select statement </p>
  
  <p>In progress procedure editor, I can compare dates easily, for example </p>
  
  <p>select date(bond-no) from accadd where date(bond-no) &lt;= Today</p>
  
  <p>This works perfectly, but i need to get this info via sql for a web page and just get an error, even breaking the field down as a substring and making the date back up doesn't seem to work</p>
  
  <p>SELECT date(""bond-no"") FROM accadd WHERE date(""bond-no"") &lt;= Date()</p>
  
  <p>Have tried variations on the above and this too...</p>
  
  <p>DATE(SUBSTRING(""bond-no"",4,2),SUBSTRING(""bond-no"",1,2),SUBSTRING(""bond-no"",7,4))</p>
  
  <p>This should return just dates earlier than today, but just get the old syntax incorrect message, so i'm missing something somewhere</p>
  
  <p>[DataDirect][ODBC Progress OpenEdge Wire Protocol driver][OPENEDGE]Syntax error in SQL statement at or about ") FROM accadd WHERE" (10713)</p>