Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hello,

Here is basic code for running SQL query in macro - click here.

Result sets (SQL return) depend upon data - see this post.

Hello,

Here is basic code for running SQL query in macro - click here.

Result sets (SQL return) depend upon data - see this post.

Here is code for SQL updating of a table - click here with the difference from the query being oStatement.executeUpdate( sSQL ).

Hello,

Here is basic code for running SQL query in macro - click here.

Result sets (SQL return) depend upon data - see this post.

Here is code for SQL updating of a table - click here with the difference from the query being oStatement.executeUpdate( sSQL ).

Edit:

This is more how your SQL need to be in the macro:

strSql = "SELECT MAX( ""diaries"".""steps"" ) FROM ""diaries"" WHERE ""diaries"".""year"" = '" & strAYear & "' AND ""diaries"".""month"" = '" & strAMonth & "' AND ""diaries"".""day"" = '" & strADay & "'"