static void TestDateTimeConversion(Args _args)
{
LoginProperty loginProperty = new LoginProperty();
ODBCConnection con;
Statement stmt;
str sqlString, result;
ResultSet resultSet;
;
loginProperty.setServer('LocalServer');
loginProperty.setDatabase('AXDB');
loginProperty.setUsername('bmssa');
loginProperty.setPassword('bmssa_pwd');
con = new ODBCConnection(loginProperty);
sqlString = "SELECT * FROM LedgerTrans WHERE DATAAREAID=' "
+ curExt()
+ "' "
+ " AND TRANSDATE
+ date2str(str2date('22/02/2006',123),321,2,3,2,3,4)
+ " ' AS datetime) "
+ " AND TRANSDATE> CAST(' "
+ date2str(str2date('20/02/2006',123),321,2,3,2,3,4)
+ " ' AS datetime) ";
stmt = Con.createStatement();
resultSet = Stmt.executeQuery(sqlString);
resultSet.next();
result = resultSet.getString(1);
if (result)
{
info(result);
}
else
{
info( "No record! " );
}
}
No comments:
Post a Comment