We are upgrading some software that uses MS Access and will now use Sql
Server.

I have a program that I have been running manually, as I knew this
change was coming.

I have this java program running from WDSC and I will be moving it to an
RPG program using JDBCR4.

When I access the Access data, I have a statement

stmt = con.createStatement();
String query = "select * from Evnlog where TimeDate >= #" + from + "#
and TimeDate < #" + to + "#" ;
ResultSet rs = stmt.executeQuery(query);

Then I do a run passing in dates like this 2011-02-19 2011-02-21

Essentially I want to do the same thing with my RPG program, however,
I'm struggling to get it working.

My sql statement
stmt = JDBC_PrepStmt(connms: 'select * from +
evnlog where TimeDate >= ? ');

I have tried
JDBC_SetTimeStamp(stmt:1: %timestamp() );
JDBC_SetDate(stmt:1: 2011-02-23 );
JDBC_SetString(stmt:1: '2011-02-23' );

This is just a pared down version of the statement I need.
TimeDate is a Timestamp field in SQL Server.



I've done a couple of these programs, but none using dates and I'm just
stumbling my way through sql server.

Any idea how to make this work?

If you need to see more info let me know.

Mike





NOTICE: This message, including any attachment, is intended as a confidential and privileged communication. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.