Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Forum
I have a sql statement. I have problems with date field [doc-fec] . When I execute the script.
SQL SELECT emp-cod, doc-fec
FROM nom_historic
wHERE (cpt-liq = 105 Or cpt-liq =125) And emp-cod = '57147' And [doc-fec] >= '22/08/2009';
How can i apply this condition ?
Thanks.
it depends on your database and on the way the database stores dates. Your syntax needs to match your DB SQL syntax - the same way you'd write a query directly on your database...
Believe that the usual SQL-syntax for dates is MM/DD/YYYY, thus would try with a WHERE-clause like
.... >='08/22/2009'.
Peter
On SQL Server, use CONVERT:
[doc-fec] >= CONVERT(DateTime, '22/08/2009', 103)
where 103 is the code for dd/mm/yyyy formatting.
Hi Forum
Thanks for yours answers. These help me to find the correct sintax:
sELECT emp-cod, doc-fec
fROM nom_his
wHERE (cpt-liq = 105 Or cpt-liq =125) And emp-cod = '57147' And doc-fec >= DATE('22/08/2009');
I´m working with Progress Database.