Macro to Create A Report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can a macro create the following report:

Using this logic, ExternalSymbol(NewId"N") and ExternalSymbol(NewID "N+1")
are not equal AND
Duration1(NewID "N+1") is less than 0:00:05.

Here's the original table:

NewID NewTime Duration1 ExternalSymbol
1 9:31:16 A
2 9:31:37 0:00:21 B
3 9:31:41 0:00:04 B
4 9:31:50 0:00:09 C
5 9:31:53 0:00:03 D
6 9:32:02 0:00:09 E

Here's the report I am trying to create:

NewID NewTime Duration1 ExternalSymbol
1 9:31:16 A
2 9:31:37 0:00:21 B
4 9:31:50 0:00:09 C
5 9:31:53 0:00:03 D
6 9:32:02 0:00:09 E


Thank you in advance.
 
Carl,

Macros do not create reports. Reports are designed using the report
design tools, and the data returned for the report to present are
usually defined in a query. The only time a macro might come into the
picture is to automate the printing of the report.

So in this case, it is a job for a query. The SQL view of such a query
might look something like this...

SELECT NewID, NewTime, Duration1, ExternalSymbol
FROM YourTable
WHERE (DMax("[NewId]","YourTable","[NewID]<" & [NewID] & " And
[ExternalSymbol]='" & [ExternalSymbol] & "'") Is Null) OR
((Duration1>"0:00:05") AND (DMax("[NewId]","YourTable","[NewID]<" &
[NewID] & " And [ExternalSymbol]='" & [ExternalSymbol] & "'") Is Not Null))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top