Problem with Query when I try to do more than one group

Hi Sap Experts,
Hopefully somebody can suggest a way to make my query work a bit better. I have built a stock warehouse query which prompt for item groupcode
see below
SELECT T1.[ItemCode] AS 'Item No.', T1.[ItemName] AS 'Item Description', T1.[BuyUnitMsr] AS 'Purchasing UoM', T1.[AvgPrice] AS 'Item Cost', T2.[OnHand] AS 'In Stock', T2.[OnHand] * T1.[AvgPrice] AS 'On-Hand Qty*Unit Price', T1.[PurFactor1] AS 'Purchasing Factor 1', T2.[OnHand] * T1.[PurFactor1] AS 'On-Hand*Purchase Factor', T2.[WhsCode] AS 'Warehouse Code', T3.[WhsName] AS 'Warehouse Name' FROM  [dbo].[OITB] T0  INNER  JOIN [dbo].[OITM] T1  ON  T1.[ItmsGrpCod] = T0.[ItmsGrpCod]   INNER  JOIN [dbo].[OITW] T2  ON  T2.[ItemCode] = T1.[ItemCode]   INNER  JOIN [dbo].[OWHS] T3  ON  T3.[WhsCode] = T2.[WhsCode]   WHERE (T0.[ItmsGrpNam] >= (N'[%0]' ) ) AND  (T0.[ItmsGrpNam] <= (N'[%1]' ) ) AND  (T2.[OnHand] > (0 ) )  ORDER BY T2.[WhsCode]
At the moment this is working fine when I select to and from a group with the same ItemCode- however I now would like to to add 2/3 itemgroupcodes to the same query.
So at the moment if I run this - it promts for the Item Group Code - I enter the to/from itemcode - the query gives me a breakdown of the item group , warehouse location for that item and if there is stock on hand for each location
However I would like to be able to select 3 distinct Item groups but don't see to be able to when I adjust the query - can you add multiple parameter to add the 3 distinct itemgroup codes
If any one could suggest a way to alter the query to allow to choose 3/4 distinct groups either using the [%1] selections or simply built into the query that would be great
thanking you in advance for any suggestions you may have
Paul

Hi Gordan,
I have been playing with the query and the conclusion i have come to is this - this way works selecting one itemgroupcode
SELECT T1.[ItemCode] AS 'Item No.', T1.[ItemName] AS 'Item Description', T1.[BuyUnitMsr] AS 'Purchasing UoM', T1.[AvgPrice] AS 'Item Cost', T2.[OnHand] AS 'In Stock', T2.[OnHand] * T1.[AvgPrice] AS 'On-Hand Qty*Unit Price', T1.[PurFactor1] AS 'Purchasing Factor 1', T2.[OnHand] * T1.[PurFactor1] AS 'On-Hand*Purchase Factor', T2.[WhsCode] AS 'Warehouse Code', T3.[WhsName] AS 'Warehouse Name' FROM  [dbo].[OITB] T0  INNER  JOIN [dbo].[OITM] T1  ON  T1.[ItmsGrpCod] = T0.[ItmsGrpCod]   INNER  JOIN [dbo].[OITW] T2  ON  T2.[ItemCode] = T1.[ItemCode]   INNER  JOIN [dbo].[OWHS] T3  ON  T3.[WhsCode] = T2.[WhsCode]   WHERE (T2.[OnHand] > (0 ) )  AND  (T1.[ItmsGrpCod] = (N'130' )) 
This query works by it self and selects the Item Group Code that I need to see.
However I can't seem to get it to work If I try to add a further group code? see code below
SELECT T1.[ItemCode] AS 'Item No.', T1.[ItemName] AS 'Item Description', T1.[BuyUnitMsr] AS 'Purchasing UoM', T1.[AvgPrice] AS 'Item Cost', T2.[OnHand] AS 'In Stock', T2.[OnHand] * T1.[AvgPrice] AS 'On-Hand Qty*Unit Price', T1.[PurFactor1] AS 'Purchasing Factor 1', T2.[OnHand] * T1.[PurFactor1] AS 'On-Hand*Purchase Factor', T2.[WhsCode] AS 'Warehouse Code', T3.[WhsName] AS 'Warehouse Name' FROM  [dbo].[OITB] T0  INNER  JOIN [dbo].[OITM] T1  ON  T1.[ItmsGrpCod] = T0.[ItmsGrpCod]   INNER  JOIN [dbo].[OITW] T2  ON  T2.[ItemCode] = T1.[ItemCode]   INNER  JOIN [dbo].[OWHS] T3  ON  T3.[WhsCode] = T2.[WhsCode]   WHERE (T2.[OnHand] > (0 ) )  AND  (T1.[ItmsGrpCod] = (N'130' ))  AND  (T1.[ItmsGrpCod] = (N'135' ))
It just seems to fail even though I know there is data for both groups - Have i missed something in the code?
I would like to be able to add 3 further group codes to the query as it will be for a report showing stock on hand once a month in the various locations
Any suggestion as to who to tweak the addtional groups
thanks
Paul

Similar Messages

  • Any problem with a single MySQL database used on more than one site?

    I have a set of multiple sites hosted separately I'm working on. I'd like to set up a PHP/MySQL database on one site, and be able to pull data from it for completely separate sites. Seems like it shouldn't be a problem. Are there any problems with doing this I need to be aware of?

    I've set up databases on three different hosts, and in all cases I could access the databases from outside the domain of the site itslef.  GoDaddy is one of them, they used to restrict it, but now they give you the option when setting up a new database on your account.

  • I updated to ios5 on another computer because i was stuck on the recovery mode loop but now the problem is that when i try sync to my current one iphone does not show up or sync at all.. any ideas? gonna try uninstall right now..

    I updated to ios5 on another computer because i was stuck on the recovery mode loop but now the problem is that when i try sync to my current one iphone does not show up or sync at all.. any ideas? gonna try uninstall right now..

    There is no way to consolidate iTunes accounts.
    Setting up an iPhone has never required creation of a new Apple ID.
    You've apparently purchased content with both Apple ID's.  Sign into the device with the correct Apple ID and sync the content.

  • TS4123 This is not correct solution. I have fresh copy of Windows 7 64 bit and I have the same problem.  Autorun only shows the Bonjour service.  It started when try to sync more than one iphone.

    This is not correct solution. I have fresh/new copy of Windows 7 64 bit and I have the same problem. 
    Autorun only shows the Apple Bonjour service.  It started when try to sync more than one iphone over WiFi. I have two iphones and an iPad. I turned off syncing over WiFi and still has high CPU utilization. One of the CPU's is pegged at 100%.  It is the AppleMobileDeviceService.exe process.

    For the record, I then followed the suggestion of MarcDCMB in https://discussions.apple.com/thread/4291206 of just manually restarting the Apple Mobile Device service in Windows services.msc once each time after starting iTunes and the service no longer hogs CPU after that service restart.  Not too painful as a work-around, and apparently an effective one, but clearly not a solution to the problem.  Again, as above, all the other solutions didn't work for me and I have no conflicting software as far as I can tell. So you'd have to say this Apple's problem.
    Also FTR, I am still on the 5.2.0.6 version of the Apple Mobile Device Support MSI and I don't know if that is relevant to this work-around working but my sense is that it is NOT relevant.  I'll report back on this thread if I re-upgrade and the problem returns in spite of the service-restart approach.

  • Problems to restrict access to a page when the user belong to more than 1 group

    I have realized that Dreamweaver on a coldfusion document only works fine when the user only belongs to a single group, this is because the code supplied by dreamweave when you use the option "Restrict access to a page" at "Server behaviors" it assumes that the user only have one group as you can see on this line created automaticly by dreamweaver:
    <cfif MM_Username EQ "" OR MM_UserAuthorization EQ "" OR ListFind("admin",MM_UserAuthorization) EQ 0>
    MM_UserAutorization has the value of the field assigned for the list of groups or levels, as you can see it could work if we reverse the parameters of the listfind function but the problem would be if we grant the access to more than one group because the sentence would be like this:
    <cfif MM_Username EQ "" OR MM_UserAuthorization EQ "" OR ListFind("Admin,Manager",MM_UserAuthorization) EQ 0>
    so both paramethers are lists therefore no user will get access to the page.
    I am trying to make a work around to fix this problem but I don't know how to get the name of the page since the Application.cfc so I can validate the access to this page against tables on my database.
    Does someone have a work around or a tip how to fix this problem?
    Thanks in advance.
    AG

    Seems like you have a problem with your group names.ctxLdap.modifyAttributes(groupName,member);Ensure that the value of your variable groupName is a a valid distinguished name.
    Note that an OU (organizationalUnit) is not a group. You do not add users to OU's, you create users in OU's.

  • Having issue when we try to print more than 300 container labels

    Hi Gurus,
    We are having issue when we try to print more than 300 container labels. Once it reaches 300 it starts to jump the sequence and we are not able to complete all the tickets if itu2019s more than 300.
    Regards
    Rajib Pathak

    dear friend,
    first, i recommend to analyse the spool request and discuss it with your basis/technical guys (use SP01)
    second,
    you would try to run t-code SPAD for your output device and check out the checkbox "Process requests sequentially" (ON)
    regards,

  • My husband has paired his phone using the remote app to the TV- I would like to do the same with my phone. Can we pair more than one phone to the tv using the remote app ?

    My husband has paired his phone using the remote app to the apple TV- I would like to do the same with my phone. Can we pair more than one phone to the tv using the remote app ?

    Yes I believe so. Try it and see you can always delete the Apple TV from a remote if it messes things up.
    But we have three remotes setup to do this. My iPhone and iPad and my wifes iPhone. She has a different iTunes logon but it seems to work fine

  • Auto creation of child requests when parent request has more than one group

    Hi,
    I have created a request dataset which has a child form for AD Group. While raising a request, if I add more than one group, how to process the approval flow. Because I will be having different different approvers for different different groups. Is there any way to create child requests automatically when we submit a request with more than one group? I am using OIM 11.1.1.5.0.
    I know in OIM 11g, whenever user raises request for more than one beneficiary/target-resource then OIM breaks that request into Child Requests. But this is not happening when I add more than one group in the same resource. Do I need to write my own code for DataValidator to split parent request into child requests upon validating child form? If so, is it going to impact the existing feature which is creating child request when parent has more than one user/resource.
    Please let me know.

    No not possible OOTB in current version. Check {thread:id=2318652} for more information.
    -Bikash

  • With iphoto it is possible to order more than one book at once?

    With iphoto it is possible to order more than one book at once? If yes, what can it be done? Thanks

    thank you! Another question regarding iphoto. I would like to disable the 'faces' feature as I don't use it nor wish to use it and I feel it slows down the program when I import a large quantity of pictures. How can I disable this feature?

  • I have business and personal e-mail accounts with different contacts. Can I have more than one address book on my iPhone?

    I have business and personal e-mail accounts with different contacts. Can I have more than one address book on my iPhone?

    Set up an additional user account and use one for work and one for personal stuff - each will have a separate address book. Turn on fast user switching for easy switching between the two.
    AK

  • How do I share my contacts with more than one group? I really don't want to have re-type them into a different group. Help!

    How do I share my contacts with more than one group without having to re-type them into each group?

    Without "pretending" to be yourself on the other phone (change settings) there's nothing else you can do.
    iOS devices are meant to be single user and can't view iCloud.com the same way a Mac or PC can do.
    You need to find a desktop or laptop machine (Mac or PC) to log in at iCloud.

  • When will this thing run more than one app at the same time?

    When will we be able to run more than one app at a time?

    As has been suggested, we won't know about future features until they announce them, but by understanding the current situation we can guess.
    The current limitations on third-party applications running in the background make sense. It's not a technical limitation. App store downloads, and the phone functionality run in the background while other applications are up front.
    It's a resource limitation. Processor power and probably more importantly battery life are the key limiting factors. It's not that Apple doesn't want you to have more functionality. It's that it currently struggling to deliver a quality experience that satisfies as many customers as possible. As it is the battery life is only just acceptable enough for most current customers, many are unhappy with it.
    So if more efficient chips or batteries become available, or some genius programmer manages to squeeze out a whole lot more out of less, then we'll see more background processes allowed.

  • IPad - with movie clips - how can I play more than one at a time?

    iPad2.  I post short movie clips via iTunes to the Photo catagory.  I can play each of these clips by selecting the clip and pressing the start arrow, only the selected clip will play.  How can I select a group of movie clips and have them play with only one selection.  Like a "slide show" but for movie clips???

    More than one contacts at a time

  • E-Mail not send when relevant BP is in more than one partner function

    Dear all,
    i am facing an big issue.
    My e-mail action does not work if the bp of the recipient is stored in more than one partner function in this incident.
    Is this a know bug ? What can i do about that?
    Best Regards
    Daniel
    Edited by: Daniel Titze on Feb 15, 2012 12:58 PM

    Hi, Daniel.
    I didn't met such a problem, but I happened to find this Knowledge Base Article (note №1521582 "Solution Manager: no mail is sent to processor of the message if sender and receiver are the same"):
    https://websmp130.sap-ag.de/sap(bD1ydSZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3135323135383226
    Hope it will be helpful.

  • ACL and user with more than one group

    I have a (simple) question, but I coudn't find answer in docs :(
    My problem is:
    I want to have in Tuxedo users, which belong to more than one ACL group. Each
    of this group have some special rights, i.e. group A could execute services K,L,M
    and group B could execute services M,N,O. If my user belongs to A and B group,
    which rights it have? Your rights are sum of rights of group or common part of
    them ? I will be very greatful for link to docs talking about it ....
    Best regards
    Dominik Michniewski

    user3715462 wrote:
    Hi All,
    it's just a question
    we're using R12 12.1.3 db: 11Gr2 on OUL5x64
    is it possible for an oracle user that can have more than one email address?
    i add 2 email addresses in E-MAIL box
    and it did not seem to work.
    Thanks in advance.
    Regards,What email addresses are you referring to? Is this at the OS level or the database/application level? Please elaborate more.
    Thanks,
    Hussein

Maybe you are looking for

  • Tehnical wage type not coming in RT table

    Wage type for Employer Pension Contribution, EDLI Contribution, EDLI  Admin Charges & PF Admin Charges not coming in RT table. Please suggest some solution, Its urgent. Regards Abhimanyu

  • Can't get sound on a movie purchased from apple tv

    Hi , can't get sound on a film from apple just purchased ? John

  • CR with Universe error: Unhandled exception in WebI server call

    Hi, I encounter an error when creating CR report with did any one ever got Unhandled exception in WebI server call when dragging objects into filter querys of query panel? This worked fine few days ago but failed now. I have check the BO servers are

  • Modufy Item Overview Screen.

    I need to modify the item over screen of Sales Order (SAPMV45A, 4900 ). At the moment i am adding a button in the screen 4401 and on clicking the button there, i get the values from the SALES order items from an Excel File. The validations that are d

  • Migrating Leopard Server software to new Start-up disk

    I have a new Xserve that I had configured with 3 -15K drives and the internal raid card and striped all 3 drives into one datapool for max performance. I am running the OS on this raid pool along with our rip software that loves lots of disk space an