Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: OPO: BETWEEN Condition

Re: OPO: BETWEEN Condition

From: Jonathan D. Fischer <jdfische_at_cacd.rockwell.com>
Date: 1997/01/13
Message-ID: <5be3ct$3bl@newssvr.cacd.rockwell.com>#1/1

This is not all that difficult. I don't know what version you are using, but I have done this several times in OPO 1.0.16. Set up a form where the user enters the two dates, numbers, people, etc. Have a button that they click that says something like "Print Report." In the buttons click method, define at least two variables. One for the first date/value, the other for the second date/value. Do whatever consistency checks on them that you need to (actually, these consistency checks should be done in the entry fields validate methods...). Assign the values of the fields to these variables. Then, do a query where statement to select all items in the database that meet the criteria (i.e.: QueryWhere(date BETWEEN date1 AND date2))
This loads a recordset that has only the subset that you desire. Now, using OPO's data-stepping utilities and column fetching utilities (GetColVal, GoNextRow, etc. - it's all in the on-line manual, in the appendices under list of properties and methods), read the values of the dataset into a variable, and insert them into a temporary table. i.e.:
vRecSet = Container.GetRecordSet()

WHILE vRecSet.GoNextRow() <= vRecSet.GetRowCount() vFirstName = vRecSet.GetColVal("First_Name") vLastName = vRecSet.GetColVal("Last_Name") EXEC SQL AT LOCAL_DATABASE INSERT INTO temp_table (first_name, last_name) VALUES (:vFirstName, vLastName)
vRecSet.GoNextRow()
LOOP EXEC SQL AT LOCAL_DATABASE COMMIT WORK (The exact syntax may be a _little_ off - better check the manual...) Then, set the reports session and table to the temporary table. It will then print out only that subset of data that you desire.

Jonathan D. Fischer
jdfische_at_collins.rockwell.com

P.S. Posting OPO problems to the "tools" newsgroup might be better...

In article <32D653AA.1C44_at_orisoft.com>, Webmestre_at_orisoft.com says...
>
>Hi,
>
>I would like to know the best way to open a form or a report according
>to conditions entered by the user. For example, I would like to print
>a
>report that will include all the records that are between 2 dates. The
>user would enter those 2 dates, either on a form or thru 2 InputBox.
>
>How can I do that. The documentation is very lame for that kind of
>"advanced" stuff. I didn't find any examples or help topics about it.
>
>Again, thank you very much
>
>
>Sam Fortin
>Sfortin_at_orisoft.com
>http://www.orisoft.com/
>http://www.softodyssey.com/
Received on Mon Jan 13 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US