rocha
#1
Pq estou tentando fazer isso e não da certo:
String sql = "SELECT ID_EMPRESA, RZSOCIAL, APELIDO, DT_VENC FROM TB_EMPRESA WHERE DT_VENC = ? ORDER BY RZSOCIAL";
ps = conexao.prepareStatement(sql);
ps.setString(1, "1/1/2000" );
rs = ps.executeQuery();
Não acontece erro nenhum só não me retorna nada mesmo tendo um registro com está data
Se faço a mesma sql no console do bd me retorna
Bd Firebird
kina
#2
postgres:
String sql = "SELECT ID_EMPRESA, RZSOCIAL, APELIDO, DT_VENC"+
" FROM TB_EMPRESA WHERE DT_VENC = convert(?,'dd/MM/yyyy') ORDER BY RZSOCIAL";
Oracle:
String sql = "SELECT ID_EMPRESA, RZSOCIAL, APELIDO, DT_VENC"+
" FROM TB_EMPRESA WHERE DT_VENC = to_date(?,'dd/MM/yyyy') ORDER BY RZSOCIAL";
Vê se assim funciona.
Falou
rocha
#3
Pô mais to usando firebird
kina
#4
[quote=rocha]Pô mais to usando firebird[/quote]Tenta usar isso,
não sei se funciona pois não uso firebird 
...where DT_VENC = cast(? as DATE)...