Help required please - can't work out how to do this

Post Author: mavrick5
CA Forum: Data Connectivity and SQL
Maybe I am just having a mental blank but I need to write a report that does the following. We have a sales header and sales detail file.  The key to the header file is the transaction number.  The transaction number is one of the keys for the detail file.  I need to be able to select the details of all transactions that may have contained products from a specified department.  eg.  a customer bought eggs on a transaction, what else was purchased on the same transaction.  Management want to know what complimentary products are sold with our premium products. Now, I know I could do this with a subquery.  However, we are using MySQL 3.51 and it does not support subqueries.

Post Author: mavrick5
CA Forum: Data Connectivity and SQL
Thanks for the reply.  I have been working on this report today and came up with the same answer.  Here is the actual query generated by CR XI if I select a single day and all departments.  SELECT `saled1`.`sprice`, `saled1`.`qty`, `saled1`.`cost`, `saleh1`.`datewhen`, `saled1`.`store`, `state1`.`descr`, `store1`.`descr`, `speople1`.`name`, `sub_dep1`.`description`, `dept_1`.`dept`, `dept1`.`dept` FROM   {oj ((((((((((`ngho`.`saled` `saled1` INNER JOIN `ngho`.`plu` `plu1` ON `saled1`.`plu`=`plu1`.`FINELINE`) INNER JOIN `ngho`.`sub_dep` `sub_dep1` ON `plu1`.`subdep`=`sub_dep1`.`subdept`) INNER JOIN `ngho`.`dept` `dept1` ON `sub_dep1`.`dept`=`dept1`.`dept`) INNER JOIN `ngho`.`saleh` `saleh1` ON ((`saled1`.`store`=`saleh1`.`store`) AND (`saled1`.`register`=`saleh1`.`register`)) AND (`saled1`.`sequence`=`saleh1`.`sequence`)) INNER JOIN `ngho`.`speople` `speople1` ON (`saleh1`.`store`=`speople1`.`store`) AND (`saleh1`.`staffno`=`speople1`.`userid`)) INNER JOIN `ngho`.`store` `store1` ON `saleh1`.`store`=`store1`.`store`) INNER JOIN `ngho`.`state` `state1` ON `store1`.`state`=`state1`.`state`) LEFT OUTER JOIN `ngho`.`saled` `saled_1` ON ((`saled1`.`store`=`saled_1`.`store`) AND (`saled1`.`register`=`saled_1`.`register`)) AND (`saled1`.`sequence`=`saled_1`.`sequence`)) INNER JOIN `ngho`.`plu` `plu_1` ON `saled_1`.`plu`=`plu_1`.`FINELINE`) INNER JOIN `ngho`.`sub_dep` `sub_dep_1` ON `plu_1`.`subdep`=`sub_dep_1`.`subdept`) INNER JOIN `ngho`.`dept` `dept_1` ON `sub_dep_1`.`dept`=`dept_1`.`dept`} WHERE  `saleh1`.`datewhen`={d '2008-01-02'} ORDER BY `sub_dep1`.`description`, `state1`.`descr`, `store1`.`descr`, `speople1`.`name`The query fails in CR XI (Failed to retrieve data error) and also fails if you run it within a query analyser (error code 1064, syntax error).  However, if you remove the brackets after the FROM clause and the corresponding ending brackets, the query works fine.How can I prevent CR from automatically adding the brackets when it dynamically builds the query?   I cannot create a stored procedure as MySQL 3.51 does not support them.

Similar Messages

  • When I open iTunes it will automatically go to full screen mode. I can't work out how to turn this off. Only iTunes opens to full screen mode.

    When I open iTunes it will automatically go to full screen mode. I can't work out how to turn this off. Only iTunes opens to full screen mode.

    Go to System Preferences (under the Apple logo in the menu bar).  Choose "General".  Click "Always close windows when quitting an application".
    That should fix it.

  • My Iphone 4 can't update apps because I am at the US store instead of the Australian store and I can't work out how to fix this.

    I don't know how it swapped to the US store. I don't think I did anything. I need to update three apps and it won't let me. I am in Australian

    See  >  Change your iTunes Store country
    Here  >  http://support.apple.com/kb/HT1311

  • Hi - I'm trying to sync iBooks on my Macbook Pro with iBooks running on my iPad. I have some pdf's download from the net I want to share between devices and I can't work out how to sync the two devices. Any help please?

    Hi - I'm trying to sync iBooks on my Macbook Pro with iBooks running on my iPad. I have some pdf's download from the net I want to share between devices and I can't work out how to sync the two devices. Any help please? I'm running Mavericks

    Thanks for your help Brij011 - much appreciated. Apologies as I'm a newbie but I've looked at the info for synching and I appear to have all the switches flicked on my iPad. Does the iPad and iBooks only sync in iCloud for purchases as I appear to be doing something wrong. I could sync ok when books was in iTunes but since migrating to Mavericks I think I'm doing something wrong!!

  • I have a macbook pro and use BT homehub 3.  can't work out how to connect my time capsule. can anyone help, thanks.

    I have a macbook pro and use BT homehub 3.  can't work out how to connect my time capsule. can anyone help?  thanks

    Just need to plug the TC in to the hub in bridge mode.. do not try and bridge the homehub.. it is not possible with the setup BT uses.
    To bridge the TC.. plug it directly into a computer by ethernet.. no other connection to the TC or the computer.
    Press and hold in reset until the front LED flashes rapidly.. about 10sec.
    Release the reset.
    Open the airport utility and setup the TC to bridge mode.
    The actual method depends on version of the OS and airport utility you use.
    This is version 5.
    Sorry I cannot post the v6 as I am on a snow leopard computer now. But you go to the network tab, and choose off bridge mode for method of connection. It will be NAT and dhcp by default.
    Then setup wireless.. you have a number of choices here.
    Either setup with the same SSID Security and password, as the homehub uses.. or a different name, and password..
    Each method works fine.. but you sometimes have issues with wireless channels.. for now leave it on auto and see what happens.. if you have issues lock down the radio channels on both devices.. use one out of the following on each, 1, 6, 11 or 13 in UK.. so say 6 on the homehub then 13 onthe TC.
    Update the TC.. unplug fromt the computer and plug it into the homehub.
    If you have other issues with the setup tell us what OS you run so we can post suitable screenshots.

  • I would like to set a block feature for Firefox Safe Mode. I can't figure out how to do this on McAffee. Help please.

    I found out that my boys can get into 'safe mode' which bypasses all blocks. I went to my McAfee home page and can't figure out how to block this browser. Can you tell me how??? THANKS!

    Create a contact for yourself either in the phone app or the contacts app. Then go - Settings > General > Siri > My Info > Set your contact.

  • I prepare chronologies in word, and i am trying to do the same in pages using tables and cells. But somtimes i need a cell to wrap onto the next page but I can't work out how to do it - any suggestions would be greatly appreciated

    I prepare chronologies in word, and I am trying to do the same in pages using tables and cells. But sometimes I need a cell to wrap onto the next page because the contents are bigger than the page or the space left on the page,  but I can't work out how to do it - any suggestions would be greatly appreciated

    brendanfromsydney wrote:
    What are the different opinions on why pages should not achieve this?
    As far as I know, Apple is free to choose to offer this or that feature.
    They never said that they want to clone Word or even compete with it.
    Differences between tables in both worlds are numerous.
    In Pages (or Numbers)
    - we can't sort a single column
    - we can't sort by row
    - we can't insert or remove a single cell
    - a cell can't cross pages boundaries
    If I understand well these design choices match :
    ++-+-+-+-+-+-+-+-++
    Apple Human Interface Guidelines:
    Apply the 80 Percent Solution
    During the design process, if you discover problems with your product design, you might consider applying the 80 percent solution‚ that is, designing your software to meet the needs of at least 80 percent of your users. This type of design typically favors simpler, more elegant approaches to problems.
    If you try to design for the 20 percent of your target audience who are power users, your design may not be usable by the other 80 percent of users. Even though that smaller group of power users is likely to have good ideas for features, the majority of your user base may not think in the same way. Involving a broad range of users in your design process can help you find the 80 percent solution.
    +-+-+-+-+-+-+-+-+-++
    Yvan KOENIG (VALLAURIS, France) jeudi 9 juin 2011 16:03:52
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.7
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • I have updated my Apple ID via my iPad, but my other devices still think the ID is the old one and I can't work out how to update them

    Yesterday, after discovering that the email address I used as my Apple ID was about to be deleted, I used my iPad to update my Apple ID to a new one.  Everything went fine, until I moved on to my iPhone, which is still asking me for the password for my OLD Apple ID.  I can't work out how to tell either my iPhone or my Macbook that this one is out of date and get them to change to the new one.  iTunes is changed, but the settings aren't.  Can anyone help me please?

    You haven't stuffed it, you just haven't signed out, so do that now, everywhere your old ID appears needs to be signed out of.
    Any variant of "Find My" (phone/mac/pad etc) that's signed in should be signed out.
    List what needs a sign out if you don't know how to.

  • I purchased Adobe ExportPDF today but can not work out how to now get PDF converted to WordDoc. Plea

    I purchased Adobe ExportPDF today but can not work out how to now get PDF converted to WordDoc. Please help.

    I know; there are so many forums - it is not always easy to find the right one at the first try.  But posting in the right forum is important; it's where the people know about the product / service.

  • I'm a new iPad owner. When I've rented a movie, I can't work out how to play it back without a wifi connection. I get a message which says you cannot connect to the iTunes store without an Internet connection. This happens whether I've rented or purchased

    I'm a new iPad owner. When I've rented a movie, I can't work out how to play it back without a wifi connection. I get a message which says you cannot connect to the iTunes store without an Internet connection. This happens whether I've rented or purchased a film. We're going on a flight soon and would ideally like to watch one on the plane. Can someone please provide some step by step instructions. Thanks.

    Rented or purchased video are watched through the videos app after you have downloaded them, iTunes on iOS devices is for buying media only.

  • I can't work out how to get facetime on my macbook pro

    I can't work out how to get facetime on my macbook pro

    FaceTime for Mac: troubleshooting FaceTime:
    http://support.apple.com/kb/TS4185?viewlocale=en_US

  • My new nano keeps going into sleep mode every copy of minutes while music is playing.  I can't figure out how to stop this.  The user guide isn't too helpful.  Any ideas?

    My new nano keeps going into sleep mode every copy of minutes while music is playing.  I can't figure out how to stop this.  The user guide isn't too helpful.  Any ideas?

    This is usually a sign that your iPod's headphones are not plugged in all the way.  Make sure that you cannot see any of the silver still showing from the headphone's plug.  You should hear a sort of popping/clicking noise when inserting the headphones letting you know that they have been fully seated.
    B-rock

  • Hi I can't work out how to go directly to my PDF conversion pack from my account

    Hi
    I can't work out how to go directly to my PDF conversion pack from my account

    If you mean the PDF Pack:
    https://cloud.acrobat.com/convertpdf
    or click on the Create PDF tab
    or use the Create PDF button in the Adobe Reader Tools
    [topic moved to Acrobat.com Services forum]

  • Slide to unlock doesn't work happend more than 8 time every time i had to restart my phone, Please can you tell me how to fix this bug . iPhone 5, iOS 7.0.4

    Slide to unlock doesn't work happend more than 8 time every time i had to restart my phone, Please can you tell me how to fix this bug .
    iPhone 5, iOS 7.0.4

    Backup and restore your software via iTunes. If the problem continues, restore as a NEW device. If this solves it, that means there is some corruption in your backup file. If the problem is still there, you should take it to the Genius Bar at an Apple Store for evaluation.

  • I keep getting a message on my phone that i need to update my email password. I can not figure out how to do this.

    I keep getting a message on my phone that i need to update my email password. I can not figure out how to do this.

    Hi there!
    Not knowing anything more than what you've posted (e.g., email provider, text of the request, etc.), we can only surmise that this must be the password revalidation that HotMail and other providers send out on a periodic basis. Here is the KB that discusses what to do:
    http://www.blackberry.com/btsc/search.do?cmd=displayKC&docType=kc&externalId=KB13137
    Hopefully that will help you.
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

Maybe you are looking for

  • PGW2200 maximum B number of digits

    In our system I need to increase maximum number of digits that are sent to other STPs. I inserted TmaxDigits=32 and OD32DigitSupport=1 to SS7 paths and to trunk group configuration. Now MGC sends out more than 16 digits but I get Cause =111, Protocol

  • Photos lost in Elements "organizer"?

    Cleaning my computer must have deleted some files in my Adobe Photoshop Elements 7 preventing me from opening the program.  It looks like the only thing I can do is reload my software.  Most of the pictures in my Organizer have been moved to "my pict

  • BOBJ - Hardware Requirement

    Hi,   We are currently having BW/BI NW 7.0 EHP1 and also ECC 6.0 EHP4. We are researching about the purchase of BOBJ enterprise. What is the general recommendations in terms of hardware requirement we should be aware of and based on the users who are

  • Problems iOS5 + camera connection kit for iPad

    My camera connection kit isn't working anymore since I use iOS5 on my iPad 1. What can I do?

  • Help me with Parallel Block in GP

    http://help.sap.com/saphelp_nw04s/helpdata/en/2d/71a9424092c511e10000000a1550b0/content.htm I read the article and I have problem with paragraph 9. It says "For parallel and parallel dynamic blocks, you can define more complex behavior and set criter