Query that show total discount on A/R Invoice

Dear all,
I would like to have query that show summary of each invoice number that show 'Total of discount'  ( 'Total of discount' = total of discount in line item + discount of total invoice ). Data that I would like to show on this query is as follow :
Invoice No, Invoice Date, Customer Code, Total before discount, 'Total of discount',  Total Amount, Vat amount
Please kindly suggest the way to get this data.
Thanks you in advanced.
Angnam

Hi Angnam K,
Try This one...hope this will serve your purpose.
SELECT  DocEntry, DocNum,   CardCode, CardName, DocDate, [Total Before Discount] , [Totaldiscount]+  [OinvDiscount] as [Total of discount], VatSum [Total Tax]      FROM (
SELECT T0.DocEntry,T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], SUM(T1.[LineTotal])[Total Before Discount],
SUM(T1.[PriceBefDi] * T1.Quantity *T1.[DiscPrcnt])/100 as [Totaldiscount]
,Case When T0.[DiscPrcnt] <> 0 Then  (SUM(T1.[LineTotal])/ T0.[DiscPrcnt]) Else 0 end [OinvDiscount] ,T0.VatSum
FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
Group By T0.DocEntry,T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T0.[DiscSum] ,T0.[DiscPrcnt],T0.VatSum )Sales
thanks,
Kumar
Edited by: itskumaramit on Jul 13, 2011 12:43 PM

Similar Messages

  • IN NEED OF A SCCM 2012 QUERY THAT SHOWS LAST TIME SOFTWARE WAS USED OR OPENED

    Hello
    I am in need of an SCCM 2012 query that shows PCs that have Visio , Adobe Professional and Visual Studio and the last time each was used or opened. I have the query below which give me the PC name and the product. Any assistance will be very helpful
    select distinct SMS_R_System.NetbiosName, SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName from SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName
    like "%adobe acrobat%pro%"
    select distinct SMS_R_System.NetbiosName, SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName from SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName
    like "%visio%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%viewer%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%service pack%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%security
    update%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%hydra%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%update%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%MUI%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName
    not like "%amd%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%microsoft visio%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%vision%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%add-in%"
    select distinct SMS_R_System.NetbiosName, SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName from SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName
    = "Microsoft Visual studio 2012 devenv" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%hotfix%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%security%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName
    not like "%update%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%service%"

    Did you create a software metering rule for each software title? if not then you need you do that first and it will take over a week before you see results.
    Also keep in mind that your query will only find x86 software titles.
    http://www.enhansoft.com/

  • SCCM 2012 QUERY THAT SHOWS SOFTWARE INSTALLED AND LAST TIME IT WAS USED OR OPENED

    Hello
    I am in need of an SCCM 2012 query that shows PCs that have Visio , Adobe Professional and Visual Studio and the last time each was used or opened. I have the query below which give me the PC name and the product. Any assistance will be very helpful
    select distinct SMS_R_System.NetbiosName, SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName from SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName
    like "%adobe acrobat%pro%"
    select distinct SMS_R_System.NetbiosName, SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName from SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName
    like "%visio%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%viewer%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%service pack%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%security
    update%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%hydra%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%update%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%MUI%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName
    not like "%amd%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%microsoft visio%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%vision%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%add-in%"
    select distinct SMS_R_System.NetbiosName, SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName from SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName
    = "Microsoft Visual studio 2012 devenv" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%hotfix%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%security%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName
    not like "%update%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%service%

    See me reply to your other post with the exact same details, in the CM07 forum.
    http://www.enhansoft.com/

  • Trying to create a query that shows Sales Order/Invoice Totals as well as Paid/Outstanding/Available Down Payments

    Currently working on SAP B1 v8.82
    I'm looking to generate a query that will give an overall report for a given customer that shows Sales Order No, Invoice No, Sales Order Total, Invoice Total, Amount Paid on Invoice, Amount Remaining on Invoice, Down Payments Available, Open on Sales Order.
    I'm not sure what the best way to select the columns in bold above.  Invoice Total should be self-explanatory.  Amount Paid should be any down payments or applied payments on the invoice.  The balance due on the invoice (which seems to be T0.DocTotal if I'm not mistaken) should = 'Invoice Total' - 'Amount Paid on Invoice'. In the Down Payments Available column I want the total amount of money on the account or on down payments that aren't tied to a Sales Order.  If a client overpaid in the past for instance and there's a credit on their account, then it should contribute to this sum.  Open on Sales Order should be pretty easy.  I guess it's just the sum of everything that is still open on the Sales Order.  I'm just not sure what the best way to sum all the un-delivered freight, tax, and line items is.  Here's what my query looks like so far.
    SELECT DISTINCT T4.[DocNum] [Sales Order No],
    T0.DocNum [Invoice No],
    T4.DocTotal [Sales Order Total]
    T0.DocTotal [Amount Outstanding],
    FROM OINV T0
    INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN DLN1 T2 ON T1.BaseEntry = T2.DocEntry AND T1.BaseLine = T2.LineNum
    INNER JOIN RDR1 T3 ON T2.BaseEntry = T3.DocEntry AND T2.BaseLine = T3.LineNum
    INNER JOIN ORDR T4 ON T3.DocEntry = T4.DocEntry
    INNER JOIN OSLP T5 ON T4.SlpCode = T5.SlpCode
    WHERE T0.CardName Like '%%[%0]%%'
    GROUP BY T4.DocNum, T0.DocNum, T0.DocTotal, T4.DocTotal
    I tried doing a little searching around for queries similar to what I need, but I could find exactly what I was looking for and I'm very unfamiliar with OJDT, JDT1, and ITR1 tables which I think might be important to finding unapplied payments...

    Thanks.  There's a few problems though.
    1)  It seems that OINV DocTotal != Balance Due.  I'm seeing a number of invoices where there was a balance due, but we applied additional money (either we took another incoming payment and applied it or applied money from the account balance, etc.) and yet it still shows a total.
    2)  It's pulling incoming payments from different customers.  I think this is because the table was joined based on "RCT2 T4 on T4.[DocEntry]  =  T3.[DocNum] and T4.[InvoiceId] = T2.[LineNum]"  In one example I have 2 incoming payments 446 and 614.  Both have the DocEntry 542, but one relates to A/R Invoice 542 (for a different client) while the other relates to Down Payment Invoice 542.  *I was able to fix this by adding WHERE T5.CardCode = [%0]*
    3)  I'm going to work with this a little bit and see if I can alter it to make it work for me.  Basically this query falls a little short on the following:
    -  Doesn't include incoming payments that aren't linked to a down payment invoice.
    -  Does not give the Invoice Total (I'd like to know how much of the SO was invoiced.  DocTotal seems to give me Amount Invoiced - Down Payments.  I'm not sure the best way to get this number.  Maybe I could do the sum of each line * tax + freight)
    -  Does not give the outstanding amount on an invoice.  The ARtotal [DocTotal] column gives me how much was owed when the invoice was created, but it doesn't tell me what is currently owed.
    -  Lastly it may complicate the query too much and could be left off, but it would be nice to see if they have any money from credits or incoming payments that has not been applied.  Perhaps this would be easily accomplished by simply pulling in their account balance.

  • Search Query that shows articles based on the current logged in users Office location

    Hi,
    I've set up a "news" channel that shows articles targeted to the current user. Basicly this on done by queryting the property of the custom "Office Location" termset.
    My setup is something like the following in my term store:
    The setup works perfect now. countries are not taggable so at the moment the user needs to choose City 1.. City 2 etc. for their articles which works fine since sometimes articles are also only targeted to cities and not countries.
    Anyways now we have got 2 users in City 4. Here it makes no sense that articles should be targeted City 3 and City 4 in order to show articles to entire Country 2. Basicle what I want here is that if an article is targeted with City 3 it should also be shown
    to City 4 users.
    How is this archived best? I have tried to make the Countries available for tagging as well, however it not show anything since the user property of course still is City 3 or City 4.
    Thanks for your time

    Hi,
    You can not get hold of the parent in your scenario. You want the parent of the tagged term in the user profile, and there is no built-in mechanism in search to get this. So as I mentioned you have to use JSOM to get the parent term, and then use that in
    your owstaxIdOfficex0020Location:term query.
    owstaxIdOfficex0020Location:{User.SPS-Location.IDWithChildren}
    would be a valid query, except it won't help you much :)
    Thanks,
    Mikael Svenson - Search Enthusiast
    SharePoint MVP/MCT/MCPD - If you find an answer useful, please up-vote it.
    http://techmikael.blogspot.com/
    Author of Working with FAST Search Server 2010 for SharePoint

  • Query that show all users who have access in BW cubes & Query's Owner

    Hi Experts,
    Good day !!!
    I would like to know if it's possible to create a query that tell us who has access to all the cubes in BW? This is a business requrement that we should create if possbile.  We also wonder if we may also create a query for shows us all the queries and who created them? We are doing this manually for each query. We only manually look for all the areas that I have access, but if it can be done systematically, that would save a lot of time.
    Thanks in advance guys !!!
    Best Regards,
    Marshanlou

    Hi,
    Then For this You need to create the table of your own fields with all the user names in R/3 side and Develop the report,
    Bue users will not the stay in same company , They will be changing and some user will be coming, every time u can t go enhancement.
    Regards
    Radha

  • Is there a way to base a collection from a query that shows all Distribution Points?

    Hi,
    I am able to create a query in Excel that shows all distribution points in my SCCM hierarchy:
    i.e.
    SELECT v_DistributionPointInfo.ServerName 
    FROM SMS_EY0.dbo.v_DistributionPointInfo v_DistributionPointInfo
    Is there anyway to get this query into SCCM Queries so that I can base a Collection off of the query.  This way, I will have a dynamic collection to show me all of my 630+ distribution points?
    Thanks!

    Thanks alot for the statement. In my situation it didn't worked. The probem is, that the data in SMS_DistributionPointInfo.Servername is written as FQN. In SMS_R_System.Name the Name is without FQ.
    I have successfuly tested the following query in SQL:
    Select
    * from
    v_r_system
    where
    v_r_system.Name0
    in (Select
    REPLACE(Servername,
    'FQN-String',
    '') from
    v_DistributionPointInfo)
    But this doesn't work in WQL
    Select
    * from
    SMS_R_System where
    SMS_R_System.Name
    in (Select
    REPLACE(Servername,
    'FQN-String',
    '') from
    SMS_DistributionPointInfo)
    Do you see another solution for my problem?
    Kind regards Stefan Somogyi

  • Trying to create a FMS query that shows available stock quantity on each Sales Order line

    Using SAP B1 v 8.82
    I realize that I may be going about this in completely the wrong way.  Here's my code:
    SELECT (T0.OnHand - T0.IsCommited + (SELECT SUM(ISNULL(T3.U_BO, 0)) FROM RDR1 T3 INNER JOIN OITM T4 ON T4.ItemCode = T3.ItemCode WHERE T3.U_BO > 0 AND T3.ItemCode = $[RDR1.ItemCode])) [available]
    FROM OITW T0
    INNER JOIN RDR1 T1 ON T1.ItemCode = T0.ItemCode
    INNER JOIN ORDR T2 ON T2.DocEntry = T1.DocEntry
    WHERE T0.WhsCode = 'ATL' AND T1.WhsCode = 'ATL' AND T2.DocNum = $[ORDR.DocNum] AND T1.LineNum = $[RDR1.LineNum]
    GROUP BY T0.OnHand, T0.IsCommited
    There is a UDF that I call upon in the RDR1 table called BO.  I created this field so that if a person wants to wait for a new batch they can "backorder" it.  In another UDF called "Available" I set up a user-defined value based on the above query.  The end result should be that whenever someone enters an item, the query finds the level of stock in the warehouse, subtracts the amount already committed, and adds back in any backorder quantities on other orders for the same item.  For example, say there's 1000 units of ITEM1 in stock, 2000 are ordered on SO # 1 and 500 are ordered on SO # 2.  The salesperson who created SO # 1 wants to wait for a new batch and types "2000" in the BO field.  I try to enter a new SO # 3 for 300 pieces.  When I key in ITEM1 on the first line, the field "Available" should update to say "500" (1000 - 2500 + 2000 = 500).
    It seems to be working, but only after the document is added.  In the example above I enter SO # 3 with a qty of 300 and when I go back to that SO I see that "Available" shows 200.  Ideally I'd like to see it say 500 while I'm working in the SO before I add it. 

    Edit2: Okay it so it works fine for any items that have a history, but it seems that if the item hasn't ever been on a Sales Order (i.e. it's not found in the RDR1 table) I get "no data found".  How can I make it simply return OnHand - IsCommited if it doesn't exist in the RDR1 table, but do the below query if it does?
    Actually that's not true.  I've got it working now.  I changed the query a bit and the update trigger, and it feels like it's working exactly like I wanted.  Query below if you're interested.
    /*Available FMS Sales Orders*/
    SELECT (T0.OnHand-T0.IsCommited+(SELECT SUM(ISNULL(T3.U_BO, 0)) FROM RDR1 T3 WHERE T3.ItemCode = $[RDR1.ItemCode]))
    FROM OITW T0
    INNER JOIN RDR1 T1 ON T0.ItemCode = T1.ItemCode
    WHERE T1.ItemCode = $[RDR1.ItemCode] AND T1.WhsCode = 'ATL'  AND T0.WhsCode = 'ATL'
    I have it on Auto Refresh -  When Field Changes "Document Total" - Refresh Regularly.
    Edit1: fixed grammatical error.

  • Query-That shows max of avaliable value

    Hi,
    My requirment is to develop a report to show all emp whose policy is going to expire ith in the user selected date intreval...
    Emp_ID--App_Date-Policy_Strt_Date--Policy_End_Date--App_Status
    101.01.2007---BlankBlank--
    NEW (New application for a Medical Insurance policy raised for employee)
    101.01.2007---01.02.200730.05.2007--
    COMPLETE (policy issued for emp with strt & end dates)
    115.05.2007---01.02.200730.05.2007--
    RENEWAL (a application is raised to renew emp policy)
    115.05.2007---01.06.200731.12.2007--
    COMPLETE (policy issued for emp with strt & end dates)
    115.12.2007---01.06.200731.12.2007--
    RENEWAL (a application is raised to renew emp policy)
    115.12.2007---01.01.200831.05.2008--
    COMPLETE (policy issued for emp with strt & end dates)
    115.05.2008---01.01.200831.05.2008--
    RENEWAL (a application is raised to renew emp policy)
    115.05.2008---01.06.200831.05.2009--
    COMPLETE (a application is raised to renew emp policy)
    So EMP 1 got valid policy untill 31.05.2009.
    When a user executes a query Inputs a date range (variable on Expiry Date) to show all employees whose policy expiry date intreval (01.05.2008 to 31.05.2008)
    it shouldn't show Emp 1 as he got valid policy untill 31.05.2009 but currently it is showing Emp 1....
    How can i achieve this
    Thanks

    Hi
    Thanks for the update....Thats not what i require
    Emp Records
    115.05.2008---01.01.200831.05.2008--
    RENEWAL (a application is raised to renew emp policy)
    115.05.2008---01.06.200831.05.2009--
    COMPLETE (a application is raised to renew emp policy)
    In the above policy the employee will have Policy which expires on 15.05.2008 and 31.05.2009.
    Currently he had a policy that expire on 31.05.2009
    When the user enter date intreval on Policy expiry date..show all the employees whose policy expires in month 05/2008 (01.05.2008 to 31.05.2008) as emp 1 has a policy which expires on 31.05.2009 he souldn't be displayed..
    How can i acheive thsi
    Thanks

  • Query to show what procedure isn´t assigned to any user!

    Hi all,
    I whant to know if anyone have a query that show all procedures from a specified user that is not granted the execute privilege to anyone!
    Tks,
    Paulo.
    i'm trying this one but don´t know if it is correct:
    select privilege, owner, table_name from dba_tab_privs
    where table_name not in (select object_name from dba_objects
    where object_type = 'PROCEDURE')
    and privilege = 'EXECUTE'
    and owner not in ('SYS','SYSTEM','XDB','DBSNMP','WMSYS')

    You can start to work with Pete Finnigan's script :
    http://www.petefinnigan.com/who_can_access.sql
    Nicolas.

  • Is it posible a query that builds dynamically the number of columns?

    Hi experts!
    I have a query that shows amounts in 12 columns corresponding on the calendar months of the year.   Now,  I need to change that getting in a previous screen how many months the user wants to see.   The query has to build dynamically the number of columns to show.    Can I do that with query designer?  How?
    I am working in V7.0.
    I appreciate your help.
    Thanks!
    Ada.

    Hi experts!
    I have a query that shows amounts in 12 columns corresponding on the calendar months of the year.   Now,  I need to change that getting in a previous screen how many months the user wants to see.   The query has to build dynamically the number of columns to show.    Can I do that with query designer?  How?
    I am working in V7.0.
    I appreciate your help.
    Thanks!
    Ada.

  • I have recently received a pdf file that, although previously opened, now shows totally blacked out?  What can I do to correct this?

    I have recently received a pdf file that, although previously opened, now shows totally blacked out?  What can I do to correct this?

    Hi rdfnra,
    Please check the Page Display preferences (File > Preferences/Acrobat > Preferences) and make sure that Show Large Images is selected. If sounds as though this PDF may have been created from a scanned document, and this preference is disabled.
    Please let us know how it goes.
    Best,
    Sara

  • Several encrypted .dmg files show much more free space that the total size of the file.

    I have several encrypted .dmg files on my macbook air running OS X 10.10.1  I have had them for years with no problems. Now suddenly, in the finder, at the bottom of the finder window where it shows the number of items and free space for a disk, it shows more free space than the full size of the .dmg file. Typically it will show about 200MB for a 100 MB file. Obviously, this is a bug, but I can find no information or discussions about it anywhere.
    Does anyone have the same problem? Any ideas how to fix it?

    Thanks for the ideas. Unfortunately, it didn't work.
    I rebuilt the spotlight index as suggested.
    I tried it twice, rebooting the computer a couple of time along the way.
    Below you can see the actual file as it occurs in the finder in its unopened form.
    Now, below here is what the finder reports at the bottom of the finder window when the file is opened and added as a virtual disk.
    Note that the total file size is 102.5 Mb
    Yet the finder says it has 234.5 Mb free!
    The actual size of the files on the disk add up to about 60 Mb
    This occurs with several similar dmg files.
    Any other ideas or experiences would be appreciated.

  • How to create a graph that shows individual totals plus cumulative ones as well?

    Hi,
    I use Numbers regularly in the most basic way possible but I'd love to create a chart/graph that shows individual totals but can also show cumulative ones.
    For example, Tune A was written in 2004 and earnt £5 that year, £7 in 2005, £8 in 2006, £9 in 2007.
    Tune B was written in 2006 and earnt £5 in that year, £2 in 2007, £3 in 2008 and £4 in 2009.
    Tune C written in 2007 earnt £1 that year, £3 the next year etc.
    I want to be able to see how each Tune is earning across the years but also see how much I earnt from all three Tunes in 2007, 2008 etc.
    Can any tell me whether it's possible, whether such thing already exists (free or paid for template is fine) or how to in simple terms?
    Many thanks.
    A.

    Setting up one simple data input table and using SUMIFS and COUNTIFS to extract summary data can be easier and more flexible than using long LOOKUP functions with multiple data input tables.   For example, this one Data table can be used to as the source for the other tables, each of which has only one formula which can be copied to other body cells:
    In B3 of 'Tune A Earnings by Year', copied down:
          =SUMIFS(Data::$C,Data::$B,$A3,Data::$A,$A$1)
    (This table can be cloned for other tunes by copy-pasting it and changing the value in A1 to the relevant tune name.)
    In B2 of 'Total Earnings by Year', copied down:
          =SUMIFS(Data::$C,Data::$B,$A2)
    In B2 of 'Total Earnings by Tune', copied down:
         =SUMIFS(Data::$C,Data::$A,A2)
    In B2 of 'By Tune by Year', copied right to column D and down:
          =SUMIFS(Data::$C,Data::$B,$A2,Data::$A,B$1)
    SUMIFS and COUNTIFS work using column-condition pairs. They are not affected by sorting or filtering the data table and update results automatically as new rows are added to the data table.
    SG

  • Query to show BP and discount groups where appropriate

    Hi Experts,
    I need some help in setting up a query to show me whether or not a BP has anything in special prices for business partners.
    Essentilly I just need to report the BP Code, BP Name and Y or N as to whether they have item codes in special prices for BPs.
    Thanks
    Jon

    Hi Jon,
    Try this one:
    SELECT T0.CardCode, T0.CardName, Case WHEN (T0.CardCode NOT IN (SELECT T1.CardCode FROM OSPP T1)) THEN 'N' ELSE 'Y' END AS 'Y/N'
    FROM dbo.OCRD T0
    Thanks,
    Gordon

Maybe you are looking for

  • How to find out which Tables have been accessed without looking at the SQL query ?

    Hi, I would like to know is there a way to find out what queries have been executed and on which tables without looking at the SQL query. I have an old C++ code which calls some library functions to access the Oracle database. The source code for the

  • Q10 crashing my computer

    Hello.  I recently got a Q10.  I downloaded BB Link to transfer some of my data ... as you know it won't transfer all of it.  I did this and all seemed to go as well as expected.  a Few days later when I plugged my phone back into my computer, it cra

  • Installing Apache-Weblogic Plug-in on RedHat 7.0

    I am trying to install the apache-weblogic plug-in on redhat 7.0 I modifed my httpd.conf with the following lines: LoadModule weblogic_module /usr/lib/apache/mod_wl.so AddModule mod_weblogic.c <Location /weblogic> SetHandler weblogic-handler PathTrim

  • Single quote in the String????

    Hello All, I want to supress the meaning of single quote in the string, so that I can use the string as one of the fields in my sql query, for doing this inserting "/" before the single code is the way or is there any other standard way to achieve th

  • Question on Selections from JTable

    The code below is what I use for selection of a table row. In my table I have a colum for deleteing the time but I don't want the Listener to do anything if they check or uncheck a checkbox. I only what the listener to work when they click on a speci