Nested If loop on Query

Hi All,
Need some help on one of the query I have. I have several conditions to be fullfilled and I need to use if-then-else syntax. However, izzit possible to if -then-else syntax on SAP B1 Query ? I have tried a few times and it returns me with various error. So far only when syntax works for me.
Thank You
Best regards,
Alex

Hi Thanga,
I have tried it out, but it doesn't work. I think there are something wrong wtih the syntax but I cant find the error.
SELECT DISTINCT T0.DocNum as 'DO#' , T0.DocStatus as 'Status', (Datename (mm, T0.CreateDate)) + (Datename (yyyy, T0.CreateDate)) as '@MonthYear',   T0.CreateDate, T0.DocTime,
T0.CardName, T1.ItemCode, round((T1.Quantity),2), T1.WhsCode, T1.U_Closing_Date, T1.U_Closing_Time2, DATEDIFF(dd, T0.[CreateDate], T1.U_Closing_Date) as "Day Difference",
If (T0.DocTime > '999' AND T1.U_Closing_Time2 > '999') BEGIN (((LEFT ((T0.DocTime),2)*60) + (RIGHT ((T0.DocTime),2))) - ((LEFT ((T1.U_Closing_Time2),2)*60) + (RIGHT ((T1.U_Closing_Time2),2)))) END ELSE
If (T0.DocTime < '999' AND T1.U_Closing_Time2 > '999') BEGIN (((LEFT ((T0.DocTime),1)*60) + (RIGHT ((T0.DocTime),2))) - ((LEFT ((T1.U_Closing_Time2),2)*60) + (RIGHT ((T1.U_Closing_Time2),2)))) END ELSE
If (T0.DocTime > '999' AND T1.U_Closing_Time2 < '999') BEGIN (((LEFT ((T0.DocTime),2)*60) + (RIGHT ((T0.DocTime),2))) - ((LEFT ((T1.U_Closing_Time2),1)*60) + (RIGHT ((T1.U_Closing_Time2),2)))) END ELSE
If (T0.DocTime < '999' AND T1.U_Closing_Time2 < '999') BEGIN (((LEFT ((T0.DocTime),1)*60) + (RIGHT ((T0.DocTime),2))) - ((LEFT ((T1.U_Closing_Time2),1)*60) + (RIGHT ((T1.U_Closing_Time2),2)))) END
FROM ODLN T0 INNER JOIN DLN1 T1 ON T0.DocEntry = T1.DocEntry
WHERE DATEDIFF(dd, T0.[CreateDate], T1.U_Closing_Date) < '0' AND T1.WhsCode = [%0]

Similar Messages

  • Issues with nested for loops - saving images from a camera

    Hi all,
    I've written a vi. to capture a specific number of images ('Image No') and save these images, outputted to a folder of my choice.  Each image is identified sequentially.  However, I wish to do a number of iterations ('Run') of this capture sequence, such that the filename of each image would be 'Filename (Run)_(Image No).png', e.g. run 5, image 10 would be 'Filename 5_10.png'.  I have tried a nested for loop for this but I receive an error 'Asynchronous I/O operation in progress' (I've attached a printscreen).
    Can anyone assist me in solving this problem? I preiously posted this in machine Vision but got no response (http://forums.ni.com/t5/Machine-Vision/Capturing-image-sequences-issues-with-nested-for-loops/m-p/19...).  Please find attached my vi.
    Kindest regards and thanks,
    Miika
    Solved!
    Go to Solution.
    Attachments:
    Labview problem.jpg ‏3841 KB
    Image sequence save to file.vi ‏48 KB

    Miika,
    the problem is not the filenam, but the name of the folder (AHHHHH!). You try to create the same folder in the outer for loop over and over again.... (it is the error message above the '======', not below )
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Nested for loop in Xquery

    hi all,
    I need to implement nested for loop in Xquery, but not able to do. Please help.
    Thanks in advance..
    Rajan

    Nested for loops are simple in Xquery. Here is a very basic example:
    Input:
    <root>
    <FirstLevel>
         <SecondLevel>
              <Value>1</Value>
         </SecondLevel>
         <SecondLevel>
              <Value>2</Value>
         </SecondLevel>
         <SecondLevel>
              <Value>3</Value>
         </SecondLevel>
    </FirstLevel>
    <FirstLevel>
         <SecondLevel>
              <Value>4</Value>
         </SecondLevel>
         <SecondLevel>
              <Value>5</Value>
         </SecondLevel>
         <SecondLevel>
              <Value>6</Value>
         </SecondLevel>
    </FirstLevel>
    </root>XQuery:
    declare namespace ns0 = "http://temp.uri/OTM";
    declare function ns0:NestedForLoop($input as element(*))    as element(*)
         <ns0:Output>
              for $firstLevel in $input/FirstLevel
              for $secondLevel in $firstLevel/SecondLevel
                    return
                  <element>{ $secondLevel/Value/text() }</element>
         </ns0:Output>
    declare variable $input aselement(*) external;
    ns0:NestedForLoop($input)Output:
    <otm:Output       xmlns:otm="http://temp.uri/OTM">
         <element>1</element>
         <element>2</element>
         <element>3</element>
         <element>4</element>
         <element>5</element>
         <element>6</element>
    </otm:Output>Of course, this case is very simple and usually you wont even loop for this you can use a simple XPath like $input/FirstLevel/SecondLevel/Value/text() to achieve the above result. So, If you are having problems in a specific case of nested for loops, please post the input and output here and we can help out.

  • Nested For Loop Trouble?

    Ok I need to have a nested for loop that asks a user to enter in a int number from 1-50. Whatever the number is, lets say 4 I need the program to count up asterisk and count down asterisks, like this.
    This is my code:
    import java.io.*;
    public class Stars {
         static int n;
         static private InputStreamReader in = new InputStreamReader(System.in);
         static private BufferedReader br = new BufferedReader(in);
         public static void main(String[] Args)throws IOException
              System.out.println("Please enter in a number to see display: ");
              String num = br.readLine();
              n=Integer.parseInt(num);
              for(int i=1;i<=n;i++)
                   for(int j=1;j<=i;j++)
                        System.out.print("*");
                   for(int j=1;j<=i;j--)
                        System.out.print("*");
                   System.out.println();
    Can someone tell me what I am doing wrong so I can figure out my mistake(s).

    Ok, well I know that the loop relies on the number entered in by the user. So if i pick 3 the three enter in the loop and counts up in a for loop and for every number it counts up to the three it does a print("*"); Now what I am getting confused about is where the other for loop comes into play. I know that I need to start from the number I have which is 3, so I need to have one less than that and then count down. The thing is that i'm not sure where or how the second for loop gets implemented into the code. Does it get nested with the first loop like this:
    for(int i=1;i<=n;i++)
                   for(int j=1;j<=i;j++)
                            for(int j=n-1;j>=i;j--)
                        System.out.print("*");
                   System.out.println();
              }Or is the second for loop on its own like this:
    for(int i=1;i<=n;i++)
                   for(int j=1;j<=i;j++)
                        System.out.print("*");
                   for(int j=n-1;j>=i;j--)
                        System.out.print("*");
                   System.out.println();
              }If someone can help me understand, for this is my first time with nested for loops.

  • Looping a query with text fields

    I need to loop a query (fields: FName,LName,Phone) in
    textboxes.
    List all textboxes in one form and be able to update the db
    with all changes at once.
    <cfloop query="ListMembers">
    <input type="text" name="FName#MemberID#"
    value="#FName#">
    <input type="text" name="LName#MemberID#"
    value="#FName#">
    <input type="text" name="PhoneName#MemberID#"
    value="#FName#">
    </cfloop>
    <input type="Submit" value="Update">
    Now i need to update the db and not sure how to do that?
    Thanks for the help

    Yes. Two ways. One using Form Action and one using a form created by a form site and embedded into your web page: Embedding Forms & Encoding Email Addresses.
    OT

  • Interrupting Nested For Loops/Sequences

    I have a lagre program consisting of nested for loops and case statements calibrating an array of patch antennas. The entire process of which will take about 15 hours. During this time, I want to have two things happen.
    Every 20 minuites or so, I want the process to stop what it's doing, follow certain commands for the measurement equipment to recalibrate itself, and then go back to what it was doing.
    I also want to protect it against unpredicted and predicted crashes. If the system needs to stop for whatever reason, I would like to be able to pick up the process where it left off. A sort of checkpoint system, where, when it passes a checkpoint, if it needs to be restarted, I can tell it to start from the last checkpoint it passed.
    Anyone had any experiece with these types of problems?

    jaysmall wrote:
    I also want to protect it against unpredicted and predicted crashes. If the system needs to stop for whatever reason, I would like to be able to pick up the process where it left off. A sort of checkpoint system, where, when it passes a checkpoint, if it needs to be restarted, I can tell it to start from the last checkpoint it passed.
    Could you open and append parameters to a file? Every time you restart execution of the vi after crashes you can look through the contents of the file to determine the last operation that was successful and continue with the last know good settings.  -SS

  • Multiplication Table with Two Nested For Loops

    I am trying to code a multiplication table in which the user enters the number of rows between 2 and 10 and enters the number of columns from 2 to 10. This must be in nested for loop format somewhat like this:
    rows has been assigned the input variable for rows and columns is the name for input value for columns
    for (int i = 1; i <=rows; i++)
    for (int j = 1; j <=columns; j++)
    i * j
    i can't figure out how to get it to print out in table format or if the calculation coding is correct. can anyone help me please?
    it should look like this for rows is 4 and columns is 7
    1 2 3 4 5 6 7
    2 4 6 8 10 12 14
    3 6 9 12 15 18 21
    4 8 12 16 20 24 28
    Edited by: hatecodingsomuch on Feb 22, 2009 8:15 PM

    hatecodingsomuch wrote:
    I refuse to ask for help from people who are acting like they are all-knowing and unwilling to help someone, considering I am asking for help...to learn. Obviously I am not understanding java very well and I don't need to be ridiculed like this from members who are supposed to help "NEW TO JAVA" individuals. Get off your high horse or get off the website. I will never use this again.Good luck with that.
    You do seem to be yet another "do my homework for me" type of flunkie. I predict you'll soon have an epiphany that software development really isn't for you.
    I hope you know how to say "Do you want fries with that, sir?" better than the next guy so you can edge him out.

  • Nested for loops

    Sorry to bother you all, but I have a small problem with my java homework.
    I have to make a nested for loop to produce the following output:
    00
    10 11
    20 21 22
    30 31 32 33
    (only goes from 0 to 3)
    Now, all I have managed to do are two simple loops, one with increment 10 and the other with increment just ++.
    Could you help me?

    Think through this logically. You need two loops. You need this output:
    00
    10 11
    20 21 22
    30 31 32 33
    Each number above has two digits (two digits, two loops...not a coincidence). So you need one loop to control the first digit, and another loop to control the second digit. Look at the values for the first digit: 0,1,2,3. Those are your first loop values. Now, each time the first loop has a value, your second loop goes through all of its values. Here's the values you need:
    First iteration:
    loop index 1: 0
    loop index 2: 0
    Second iteration:
    loop index 1: 1
    loop index 2: 0,1
    Third Iteration:
    loop index 1: 2
    loop index 2: 0,1,2
    Fourth Iteration:
    loop index 1: 3
    loop index 2: 0,1,2,3
    Notice the pattern for loop 2? Look at the starting value for each iteration, and notice the ending value. That gives you your loop constraints.

  • Nested for loops error

    Hi all Community members,, I am facing problem with pulling attributes from a xml which I have created. I am using nested for loop. Please kindly help me out to solve this problem....
    Thanks in advance...
    Below is the code & xml ...
    import flash.events.Event;
    import flash.events.EventDispatcher;
    import flash.events.*;
    import flash.net.*;
    var myXML:XML;
    var voiceOver:String;
    var startOffset:Number;
    var slideData:Array;
    var id_cont_array:Array = new Array();
    var id_textfield_array:Array = new Array();
    var id_image_array:Array = new Array();
    var myXML_Container_Length:Number;
    var myXML_textField_Length:Number;
    var myXML_images_Length:Number;
    var loader:URLLoader = new URLLoader();
    loader.load(new URLRequest("dynamic.xml"));
    loader.addEventListener(Event.COMPLETE,processXML);
    function processXML(e:Event):void
    slideData=new Array();
    myXML = new XML(loader.data);
    loader.removeEventListener(Event.COMPLETE, processXML);
    loader.removeEventListener(IOErrorEvent.IO_ERROR, loadError);
    myXML = new XML(e.target.data);
    voiceOver = myXML. @ voice_over;
    startOffset = myXML. @ start_offset;
    for (var i : uint = 0; i<myXML.*.length(); i++)
      //trace(myXML + "slide");
    //myXML_List = myXML.children();
    myXML_Container_Length = myXML.children().length();
    //trace(myXML_Container_Length+ "==myXML_Container_Length")
    //myXML_textField_Length = myXML.containerss[0].children().length();
    //myXML_images_Length = myXML.children().length();
    //trace(myXML.child("containerss")[3]. @ id.toXMLString()+ "==myXML.containerss[0]. @ id;");
    //trace(myXML.containerss[0].textfield[0]. @ id+ "==myXML.slide.containerss[0]. @ id");
    //trace(myXML.containerss[0].textfield[1]. @ id+ "==myXML.slide.containerss[1]. @ id");
    //trace(myXML.containerss[3].image[0]. @ id + "==image[0]");
    //trace(myXML.containerss[0].children() + "==myXML.containerss[0].children()");
    for (var j:Number=0; j<=myXML_Container_Length; j++)
      id_cont_array.push(myXML.containerss[j]. @ id);
      //trace(myXML.containerss[j].children().length() + "==j");
      myXML_textField_Length = myXML.containerss[j].children().length();
      trace(myXML_textField_Length + "==myXML_textField_Length");
      for (var k:Number=0; k<=myXML_textField_Length-1; k++)
       id_textfield_array.push(myXML.containerss[j].textfield[k]. @ id);
       //id_image_array.push(myXML.containerss[k].image[j]. @ id);
       trace(id_textfield_array[k] + "==id_textfield_array[k]==" + k + "---j==" + j);
       //trace(id_image_array[k] + "==id_image_array");
      //trace(id_textfield_array[j]+"==id_cont_array[j]");
    //trace(myXML_List.length() + "===myXML_List");
    function loadError(e:IOErrorEvent):void
    trace("loadError");
    /// XML is as given below..
    <slide orientation="VERTICAL" voice_over="Slide1.mp3" start_offset="0" margin="">
    <containerss id="0" orientation="HORIZONTAL" padding="10" margin="10" x="10" y="160" width="200" height="150">
      <textfield id="Text1" text="textfieldText1" padding="10" margin="10"  x="10" y="160"/>
      <image id="img1" text="" padding="10" margin="10" x="10" y="160"/>
      <textfield id="Text2" text="textfieldText2" padding="10" margin="10" x="10" y="160"/>
    </containerss>
    <containerss id="1" orientation="HORIZONTAL" padding="10" margin="10" width="200" height="200" x="10" y="160">
      <textfield id="Text3" text="textfieldText3" padding="10" margin="10" x="10" y="160"/>
      <image id="img2" text="" padding="10" margin="10" x="10" y="160"/>
    </containerss>
    <containerss id="2" orientation="VERTICAL" padding="10" margin="10" width="200" height="150" x="10" y="160">
      <textfield id="Text5" text="textfieldText5" padding="10" margin="10" width="200" height="150" x="10" y="160"/>
      <image id="img3" text="" padding="10" margin="10" x="10" y="160"/>
      <textfield id="Text6" text="textfieldText6" padding="10" margin="10" x="10" y="160"/>
    </containerss>
    <containerss id="4" orientation="VERTICAL" padding="10" margin="10" width="200" height="150" x="10" y="160">
      <textfield id="Text7" text="textfieldText7" padding="10" margin="10" width="200" height="150" x="10" y="160"/>
      <image id="img4" text="" padding="10" margin="10" x="10" y="160"/>
      <textfield id="Text8" text="textfieldText8" padding="10" margin="10" width="200" height="150" x="10" y="160"/>
    </containerss>
    </slide>

    Parsing is totally wrong. You function processXML() should be like that:
    function processXML(e:Event):void
              slideData = new Array();
              loader.removeEventListener(Event.COMPLETE, processXML);
              loader.removeEventListener(IOErrorEvent.IO_ERROR, loadError);
              myXML = new XML(e.target.data);
              voiceOver = myXML.@voice_over;
              startOffset = myXML.@start_offset;
              myXML_Container_Length = myXML.children().length();
              var node:XMLList;
              for (var j:Number = 0; j <= myXML_Container_Length - 1; j++)
                        id_cont_array.push(myXML.containerss[j].@id);
                        node = myXML.containerss[j].children();
                        myXML_textField_Length = node.length();
                        for (var k:Number = 0; k <= myXML_textField_Length - 1; k++)
                                  switch (node[k].name().toString())
                                            case "textfield":
                                                      trace(node[k].@id);
                                                      id_textfield_array.push(node[k].@id);
                                                      break;
                                            case "image":
                                                      id_image_array.push(node.@id);
                                                      break;

  • Capturing image sequences - issues with nested for loops

    Hi all,
    I've written a vi. to capture a specific number of images ('Image No') and save these images, outputted to a folder of my choice.  Each image is identified sequentially.  However, I wish to do a number of iterations ('Run') of this capture sequence, such that the filename of each image would be 'Filename (Run)_(Image No).png', e.g. run 5, image 10 would be 'Filename 5_10.png'.  I have tried a nested for loop for this but I receive an error 'Asynchronous I/O operation in progress' (I've attached a printscreen).
    Can anyone assist me in solving this problem?  Please find attached my vi.
    Kindest regards and thanks,
    Miika
    Solved!
    Go to Solution.
    Attachments:
    Image sequence save to file.vi ‏48 KB
    Labview problem.jpg ‏3841 KB

    Hi,
    You cannot create a folder if this one is already existing.
    Just check that the folder exists before creating it.
    Regards

  • Trouble with nested foreach loop

    I got 3 nested foreach loop but the 2nd and the third one outputs no data.
    $vss = "vSwitch3"
    $vmhost_array = @("host1,host2,host3")
    $vss_vlan_array = @("vlan50")
    $dvs_vlan_array = @("n1kv_vms_vlan50")
    foreach ($vmhost in $vmhost_array) {
    foreach ($vss_vlan in $vss_vlan_array) {
    foreach ($dvs_vlan in $dvs_vlan_array) {
    Get-VMHost $vmhost | Get-VirtualSwitch -Name $vss | Get-VirtualPortGroup -Name $vss_vlan | Get-VM | Get-NetworkAdapter | Set-NetworkAdapter -Portgroup $dvs_vlan -Confirm:$false
    I get runtime error at Get-VirtualSwitch -Name $vss 
    $vss says vlan50 not found. but its there. anything wrong with this nested foreach?

    hi
    I am actually getting an error on 
    Get-VirtualPortGroup -Name $($vss_vlan_array[$i])
    Its trying to give me the whole array instead of the 1st item in the array. so get-virtualportgroup will fail.
    I checked it with $vss_vlan_array[0] and gives me 
    "vlan50","vlan49"
    how do one item at a time instead of the whole array?

  • Beginner Question: Won't execute index to nested while loop

    Problem:
    I have a nested while loop inside a for loop. The for loop runs over and over from 0 to 587. I want the while loop to only execute when the for loop hits 587 by means of a continue condition which is on when 587 = [ i ], the for loop iteration number. However when I try to change the value sent to the while loop from 588 none of the probes execute. This is bad because the index only runs from 0 to 587 and never equals 588.
    Context:
    This is for real time video analysis. Trying to convert a 658 x 492 color video feed frame by frame into low resolution grayscale video. With this index error the output is currently the top left 1/4 of the image, repeated in a 2x2 grid on the image display.
    The VI is attached. I'm very appreciative of your thoughts on this.
    Attachments:
    Bin.vi ‏237 KB

    The for loop is responsible for processing a frame. At the completion of the execution of [ i ] from 0 to 587, the replace array VI outputs the final product of the frame. So every time [ i ] = 587, the replace array VI needs to send its array to the arraytoimage, which in turn must send the image to the image display.
    I got rid of the while loop and replaced it with the case structure. 
    Maybe the problem is with the false case of the case structure? I want to continue outputting the same image for the next [0, 586] each time after it sends an updated image on the [ i ] = 587 iteration.
    Attachments:
    Bin.vi ‏238 KB

  • How to LOOP SELECT Query in Oracle?

    Hello
    I have a query which use a variable (:enddate) and returns a set of data. Lets assume it gives sales totals by account for a given month (specified using the variable :enddate). So the query would look something like :
    SELECT ACCOUNT_NO, SUM(SALE_AMT) TOTAL_SALES FROM SCHEMA1.SALES_LINES, :ENDDATE as END_DATE WHERE SALE_DATE BETWEEN addmonths(:ENDDATE,-1) and :ENDDATE
    GROUP BY ACCOUNT_NO
    Now, currently, I have to run this query each time I need results for a particular date, and thats OK but the problem arises when I need to run this query for an entire year. Then I have to run the query 12 times, passing the date variable each time and re-running the query.
    What I would like to do, is to create a loop which covers a time period entered by the user (e.g. user enters 12 months as the total time and 1 month as the period, and the query automatically runs for the previous 12 months, passing :enddate 1 month at a time and then presents the combined results) OR takes a bunch of dates entered in an array, (e.g. :enddate in (JAN-31-2009, Feb-28-2009, MAR-31-2009, APR-30,2009 etc) and runs the query for each of them and presents the results together in one set.
    How can I do this using a simple PLSQL loop? I would like to avoid creating a procedure if possible. Sample code will be much appreciated.
    BTW, I am using Oracle XE 10g.
    Thanks

    Hi,
    It will be more efficient to get all the results at once, rather than running 12 separate queries.
    You can do that without loops or PL/SQL, something like this:
    SELECT    account_no
    ,       TRUNC (sale_date, 'MONTH')     AS mnth
    ,        SUM (sale_amt)          AS total_sales
    FROM        schema1.sales_lines
    WHERE       sale_date     >  ADD_MONTHS (:enddate, -12)
    AND       sale_date     <= :enddate
    GROUP BY  account_no
    ,            TRUNC (sale_date, 'MONTH')
    ;Of course, you can do a query like this within PL/SQL if you need to.
    If you'd care to post some sample data (CREATE TABLE and INSERT statements) and the results you want from that data, then I could test it.
    Simplify as much as possible. For example, instead of 12 sepaarte months, you can post just 2 or 3. Adapting the solution for 12 months should be easy.
    In pure SQL, bind varibales can't be DATEs, but you could define the bind variable as a string and use TO_DATE to convert it to a DATE, OR use a substitution variable instead of a bind variable.
    The solution above works in all versions Oracle. The way you're using :enddate in the FROM clause, and a function called addmonths (rather than ADD_MONTHS) makes me wonder if you're using Oracle at all.

  • ORA-00935:  group function is nested too deeply - SQL Query is correct...

    select s.sname, to_char(sum(t.amount), 'fm$999999.00')
    from transactions t, salespeople s
    where t.sid = s.sid
    group by s.sname, t.year
    having (t.year = 1997) and max(sum(t.amount));
    I'm trying to print sales person name who had the highest total sell in 1997. I do not see where did i go wrong in the above query...Isn't nested group function allowed?!
    What about this?
    select s.sname, to_char(sum(t.amount), 'fm$999999.00') as "TOTAL"
    from transactions t, salespeople s
    where t.sid = s.sid
    group by s.sname, t.year
    having (t.year = 1997) and sum(t.amount) = (select max(amount) from transactions where year = 1997);
    It should return something, but it does not due lack of data in database. I think the above code is correct. I just need to confirm from you...

    select s.sname, (case when sum(t.amount) > sum(t2.amount)
    then sum(t.amount)
    else sum(t2.amount)
    end) "TOTAL"
    from transactions t, salespeople s
    where t.sid = s.sid
    group by s.sname, t.year
    having t.year = 1997
    union
    select s.sname, sum(t2.amount)
    from transactions t2, salespeople s
    where t2.sid = s.sid
    group by s.sname, t2.year
    having t2.year = 1997;
    Your code looks good, but it does not work in Oracle Developer...
    The above should work isn't it? The inner query gets executed then the outer one so the result i get in

  • A nest within a nest and the multiple-query blues...

    Hi all:
    Complex problem here, so bear with me please. I'm still
    building this corporate database for purposes of inventory
    tracking, and my latest problem follows. Here's the setup.
    I have a MySQL database with 3 tables (there are actually
    more, but those are the only ones that are relevent):
    units_main' stores information about machinery such as its
    model number and invoice number.
    di_options_main' keeps track of what accessories are added
    to a given unit through the use of a foreign key, in this case an
    auto-generated integer called 'unit_id' which is primary in
    units_main and secondary in this table.
    valid_options stores the values such as manufacturer and
    type for the accessories mentioned earlier, linked through the
    common key of 'model_number'.
    Now I have a searching engine which brings up a standard
    results page (a regular table with a repeating recordset) of all
    units matching the given search criteria. I want to be able to look
    at this search results page and see not only the data retrieved
    from the units_main table, but also some of the related data in
    di_options_main. For instance, suppose I have an L3400 tractor with
    an LA703 loader. The tractor is listed in units_main, while the
    loader is found in di_options_main. I could create one recordset
    for the main tractor data and one for the loader (option) data, but
    this screws up the repeating recordset. Further, in this case, the
    data needs to be retrieved from di_options_main based on the 'type'
    field of valid_options - I only want to see accessories of the type
    'LOADER'. This puts the query about three generations back. I might
    still be able to code this if it weren't for the repeated region,
    which can't be nested and throws a wrench in the works. I know this
    is a difficult question, but I can post code for one or all the
    files involved if it sounds like something someone can help me
    with. Thanks in advance.

    What you need to do is join all the tables into a query in
    the database,
    then use this as a source for the recordset on the page. You
    need to use
    nestes repeat regions to display the detail information.
    Depending upon the
    server language you are using there are extensions that can
    do this for you.
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "Ken Ha Quad" <[email protected]> wrote in
    message
    news:[email protected]...
    > Hi all:
    >
    > Complex problem here, so bear with me please. I'm still
    building this
    > corporate database for purposes of inventory tracking,
    and my latest
    > problem
    > follows. Here's the setup.
    >
    > I have a MySQL database with 3 tables (there are
    actually more, but those
    > are
    > the only ones that are relevent):
    >
    > '
    units_main' stores information about machinery such as its
    model
    > number and invoice number.
    >
    > '
    di_options_main' keeps track of what accessories are added
    to a
    > given
    > unit through the use of a foreign key, in this case an
    auto-generated
    > integer
    > called 'unit_id' which is primary in units_main and
    secondary in this
    > table.
    >
    > '
    valid_options stores the values such as manufacturer and
    type for
    > the
    > accessories mentioned earlier, linked through the common
    key of
    > 'model_number'.
    >
    > Now I have a searching engine which brings up a standard
    results page (a
    > regular table with a repeating recordset) of all units
    matching the given
    > search criteria. I want to be able to look at this
    search results page
    > and see
    > not only the data retrieved from the units_main table,
    but also some of
    > the
    > related data in di_options_main. For instance, suppose I
    have an L3400
    > tractor
    > with an LA703 loader. The tractor is listed in
    units_main, while the
    > loader is
    > found in di_options_main. I could create one recordset
    for the main
    > tractor
    > data and one for the loader (option) data, but this
    screws up the
    > repeating
    > recordset. Further, in this case, the data needs to be
    retrieved from
    > di_options_main based on the 'type' field of
    valid_options - I only want
    > to see
    > accessories of the type 'LOADER'. This puts the query
    about three
    > generations
    > back. I might still be able to code this if it weren't
    for the repeated
    > region, which can't be nested and throws a wrench in the
    works. I know
    > this is
    > a difficult question, but I can post code for one or all
    the files
    > involved if
    > it sounds like something someone can help me with.
    Thanks in advance.
    >

Maybe you are looking for

  • How do I remove an iCloud account from contacts on my Mac

    As many other people I have two iCloud accounts, one that was my forme me account and the other is the one I used to purchase apps in the app store. When iCloud arrived we (Me users) were given 20GB extra storage on our iCloud accounts for one year.

  • VERTICAL SLIDING BAR ON RIGHT HAND SIDE OF THE SCREEN HAS DISAPPEARED - HOW DO I GET IT BACK PLEASE?

    VERTICAL SLIDING BAR ON RIGHT HAND SIDE OF THE SCREEN HAS DISAPPEARED - HOW DO I GET IT BACK PLEASE?

  • OHJ Error Msg

    Hello, I have Oracle 9.2.0.1.0 and developer suite release 2 9.0.2.0.0 installed on Red Hat 8. I did a full install of Developer and after a few fixes it installed ok. I installed it to a new ORACLE_HOME. When I use it I have to switch to the develop

  • Image with transparent frame, how to achieve that?

    Hi there, I wonder if you can help me at all. On my website I am displaying some pictures in landscape mode which works absolutely fine. The size is 640x450px. I have run into a problem today when tried to display a portrait picture which has a size

  • Can't see closed captions

    I followed the tutorial for making subtitles in Adobe Premiere CC. The problem is that I can see the titles in the closed captions tab, but it isn't visible in the program monitor, also after enabling closed captioning display.