Query with two registers, when i use two taxcode

Hi everybody, my question in this opportunity, it's about  this query:
/*LIBRO DE COMPRAS CELULAR STRA S.A. DE C.V.*/
SELECT T0.[TaxDate] Fecha,
       T0.[NumAtCard] 'DOCUMENTO',
       T1.[U_RegIva] 'NRC',
       T0.[CardCode] 'CODIGO DE PROVEEDOR',
       T1.[U_NIT] 'NIT',
       T0.[CardName] 'NOMBRE DE PROVEEDOR',
       SUM(CASE 
              WHEN T2.[TaxCode] = 'IVAEXE' THEN T2.[LineTotal]
              ELSE 0
           END) 'LOCALES EXENTAS',
       0.00 ImportacionesExentas,
        (SELECT sum(T12.[LineTotal]) FROM PCH1 T12 INNER JOIN OPCH T10 ON T12.[DOCENTRY] = T10.[DOCENTRY] WHERE T12.[AcctCode] != '11209' AND T12. [TaxCode]  = 'IVACCF' AND T12.[DOCENTRY] = T0.[DOCENTRY]  AND T10.[TaxDate] >= '[%0]' and T10.[TaxDate] <= '[%1]') 'LOCALES GRAVADAS',
        0.00 Importaciones,
        T0.[VatSumSy] 'CREDITO FISCAL',
              T0.[DocTotal]+
T0.[DocTotal] -(CASE
                     WHEN  T2.[ACCTCODE] = '11209'
                     THEN ((SELECT (T12.[LineTotal]*-1)
                     FOM PCH1 T12
          INNER JOIN OPCH T10 ON T12.[DOCENTRY] = T10.[DOCENTRY]
                WHERE T12.[AcctCode] = '11209' AND
                ---T12.[TaxCode]  = 'IVACCF' AND
                 (T12.[DOCENTRY] = T0.[DOCENTRY])  AND
                     T10.[TaxDate] >= '[%0]' and T10.[TaxDate] <= '[%1]'))
                       ELSE T0.[DOCTOTAL] END) 'TOTAL COMPRAS', --This statement, cause the error, or,  think so i
        (SELECT SUM(T13.[WTAMNT]) FROM PCH5 T13 WHERE (T13.[WTCode] = 'RET1' OR T13.[WTCode] = 'RET2') AND T13.[ABSENTRY] = T0.[DOCENTRY] )'RETENCION IVA',
       0.00 ComprasExcluidos
FROM OPCH T0
   INNER JOIN OCRD T1 ON T0.[CardCode] = T1.[CardCode] INNER JOIN PCH1 T2 ON T0.[DocEntry] = T2.[DocEntry]
WHERE T0.[TaxDate] >= '[%0]' and T0.[TaxDate] <= '[%1]' AND T1.[Country] = 'SV' AND T0.[Series] = 7 and
   t0.docnum not in (SELECT distinct T0.[DocNum] FROM [dbo].[OPCH] T0 INNER JOIN [dbo].[PCH1] T1 ON T0.DocEntry = T1.DocEntry
                                                                      inner join RPC1 T2 on t1.trgetEntry=t2.docentry INNER JOIN ORPC T3 ON T2.DocEntry = T3.DocEntry
                     WHERE T3.[TaxDate] >= '[%0]' and  T3.[TaxDate] <= '[%1]' and t3.series=9) AND
      T0.NumAtCard NOT LIKE '%F%' AND
      T0.NumAtCard NOT LIKE '%REDIGIT%'
GROUP BY T0.[TaxDate],
         T0.[DocNum],
         T0.[CardName],
         T0.[CardCode],
         T1.[U_NIT],
         T0.[VatSumSy],
         T0.[DOCENTRY],
         T0.[DocDate],
         T0.[DOCTOTAL],
         T0.[NumAtCard],
         T1.[U_RegIva],
        T2.[AcctCode],
        T0.[DocTotal]
the result shows two line with the information of one vendor invoice,
example:
numatcard     cardcode      tax exempt     local shopping   tax     total
12345           0125             0.00             100         13      115
12345           0125             2.00             100         13      115
i think this be must to tax indicator, because in the document i use two diferent taxcode. i need help to avoid this error, if somebody know how resolved, me will great util

Well Gordon,
If you see in the statement, the register is in one line:
(SELECT sum(T12.[LineTotal]) FROM PCH1 T12 INNER JOIN OPCH T10 ON T12.[DOCENTRY] = T10.[DOCENTRY] WHERE T12.[AcctCode] != '11209' AND T12. [TaxCode] = 'IVACCF' AND T12.[DOCENTRY] = T0.[DOCENTRY]  AND T10.[TaxDate] >= '[%0]' and T10.[TaxDate] <= '[%1]')
to better expalin.
i have this line  without tax, i only need a statement in the that be sum, the line of tax exempt + line without tax + tax total.
if you see in the query, i've excluded the acctcode = '11209', really without this filter, only  i need select the doctotal to view the result. but if, i do a statement where only excluide the document line where appear this account, the quey returns a wrong

Similar Messages

  • HT4245 i use a macbook pro which came with facetime i have an iphone 4S as well. whenever i use the wireless on my iphone i can facetime with ease however when i use the same wireless for my mac to facetime the call always gets disconnected.

    i use a macbook pro which came with facetime i have an iphone 4S as well. whenever i use the wireless on my iphone i can facetime with ease however when i use the same wireless for my mac to facetime the call always gets disconnected.

    To use factime on your Mac, I believe you will need to use your email address to do so instead of your wireless number.  Since you can't make calls on the Mac.

  • How can I work with lightroom when I use two computers ?

    I am new to Lightroom and work with a laptop at home and a PC at work. Before I started to use LR3 I simply duplicated my pic files onto both machines, edited on whichever machine I wanted and then synchronised the folders. This system provided me with a working copy at either home or work and also a backup copy on the other machine.
    I would like to operate the same system with LR3 but am unable to figure it out due to the automatic filing system used by the programmme to seperate the raw files and the instructions for those files.
    Can anyone provide me with simple step by step instructions on how to transfer the files/instructions by using  a flash drive and "Copy and replace"system
    as I am totally confused by the grammar, syntax, and terminology used by Adobe.

    Hi Geoffbubbles,
    if you see only 1 photo you did export only 1 photo in the catalog.
    Make sure you select all (e.g. <ctrl> A or remove the tick from "export selected photos only" in the dialog box of export-as-catalog =>will pick the total folder).
    What Dorin mentions are catalogs as transportation vehicles between the two LR computer catalogs.
    Let's assume you start on your home-comp and transfer to the work-comp.
    When you EXPORT you give a name "home-to-work" for the transport catalog. You decide if you include the pictures by ticking "exclude negative files".
    You would do so only for the first time, when your work-comp would not yet have them.
    These are the original files which would never be touched, but which LR needs to have available to do develop work (i.e. to write develop instructions into its database). [Or maybe only you need them in order to have LR display the effects of what you are doing, if your slider settings achieve your desired result.]
    When you transfer your new settings from the work-comp to the home-comp which has the original files already you only need to transfer the DB-records for the files, i.e. the catalog parts. Then it is sufficient to export-as-catalog (name it "work-to-home") without the tick for the negative files. Which will obviously save a lot of data to transfer.
    As would leaving off the tick for "include available previews", but then your receiving computer would have to render the previews itself - your choice where you spend the effort.
    Depending on your ticks checked in export dialog the data on the transfer stick will show different folders:
    1 wrapping folder with the name you specified as transportation catalog name (in the example above "home-to-work")
    therein the catalog file *.lrcat (home-to-work.lrcat)
    if "include negative files" ticked: as many subfolders as the original folder structure/names of the pictures in it had on the sending machine
    if "include available previews" ticked: an *Previews.lrdata-folder ("home-to-work Previews.lrdata") with lots of subfolders labelled 0...F
    On the receiving computer, when you IMPORT FROM CATALOG, you only select the *.lrcat-file.
    In the dialog box you decide if you import the negative files (prereq you had included them) or if you just add them without moving (why not leave them on the stick i.o. actually copying over to the work-comp?). If there are no new photos, but just new settings, you can either overwrite your old settings (which is probably your intention) or tick "preserve old settings as virtual copies".
    When you use Dorins smart collection "Touched today" the virtual copies should not show up upon re-export on the way "work-to-home", provided you have further tweaked the master versions only. Or they do because in the end you liked them better and continued tweaking on them.
    Note if you do not include previews: you might need to tell LR on the receiving comp to rerender the previews if it contains the photos and earlier previews already - I am not sure, if LR starts off on its own to rerender them.

  • Executing query with arguments- issue when  parameter value contains '&'

    My application inserts 'First name', last name' and last upd date to the table. it inserts all the data properly. Next level I access the information along with other tables using same arguments. But it is not fetching any data. I noticed it happens whenever the '&' is included in the parameter (first name). eg:
    'Margaret & John'. From the logs I noticed that first name it is not taking what I passed. It just stripping the first name from '&' onwards and taking only 'Margaret'. Here is the example from the log. You could notice only 'Margaret' instead of 'Margaret & John' in place of first argument.
    <2007-03-29 11:35:51,425> <DEBUG> <default.collaxa.cube.ws> <Database Adapter::Outbound> <oracle.tip.adapter.db.DBInteraction executeOutboundRead> Executing query with arguments [Margaret , Cohen, 2007-03-29T11:35:51-06:00]
    Appreciate your help if you could give me a hint how to resolve this issue
    Thanks
    Reddy

    Hi Reddy,
    from the log it looks like the DbAdapter received the value as 'Margaret '. Because parameter binding is used by default, the database shouldn't try to interpret the & as it is inside a bind variable.
    Could it be that the & is getting dropped somewhere else? Marc was suggesting you put that value inside a CDATA section or escape it. He probably showed that but when he hit Post Message it displayed the escaped & as &. I think we should find out where that & got dropped though. Normally BPEL will preserve it.
    Thanks
    Steve

  • Query with bind variable, how can use it in managed bean ?

    Hi
    I create query with bind variable (BindControlTextValue), this query return description of value that i set in BindControlTextValue variable, how can i use this query in managed bean? I need to set this value in String parameter in managed bean.
    Thanks

    Put the query in a VO and execute it the usual way.
    If you need to, you can write a parameterized method in VOImpl that executes the VO query with the parameter and then call that method from the UI (as a methodAction binding) either through the managed bean or via a direct button click on the page.

  • SAP Query (SQ01) who and when to use the report

    HI Experts!!!
    Is there somewhere recorded information:  who and when to use the report from SAP Query (SQ01)?
    Thanks

    Hi
    This topic doesn´t belong to the Service Marketplace Area.
    regards Martin

  • I've a problem with QuickTime controlbar when I use transparent wmode

    Hello All,
    I've a problem with QuickTime controlbar. When I use this code :
    <object height="592" width="690" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B">
    <param value="http://streamer.podcast.ulg.ac.be/reflexions/scienceensamusant/doccafe/D ocHorlogesBis.mov" name="src">
    <param value="true" name="autoplay">
    <param value="true" name="controller">
    <param value="true" name="kioskmode">
    <param value="true" name="loop">
    <param value="video/quicktime" name="type">
    <param value="transparent" name="wmode">
    <embed height="592" width="690" type="video/quicktime" loop="true" kioskmode="true" controller="true" autoplay="true" pluginspage="http://www.apple.com/quicktime/download/" src="http://streamer.podcast.ulg.ac.be/reflexions/scienceensamusant/doccafe/Doc HorlogesBis.mov">
    </object>
    with transparent wmode, the controlbar don't print correcty on IE7/IE8.
    If I use this code without wmode='transparent', It work but my css menu doesn't work.
    Anybody can help me ? Thank in advance.
    JP

    Hello,
    The suggestion made by Golubkov is correct. Make sure that you have configured the CAN objects to correspond to the Ports- for instance, Port1 to CAN0 and Port 2 to CAN1.
    If this dosen't fix the problem, let us know what the error message clearly states ( can be found out by clicking on the details tab).

  • I have an IPod touch 4 gen. And I'm having problems with the audio when I use other than Apple brand earphones

    I have an Ipod Touch 4 gen. and I'm having problems with audio when I use other than Apple brand earphones. I'm talking about music only so far, when I use apple earphones all is fine, but if I use other type of phones ( sony for exemple ) I can only hear the music and the background but not the lead singer voice, can anybody explain this to me? thank you.

    - Try cleaning out/blowing out the headphone jack. Try inserting/removing the plug a dozen times or so.
    - If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar                                      

  • Problems with sound quality when ripping using apple lossless

    When ripping cd with apple lossless I have problems with parts of the songs falling out. It does not apply for all songs. I use a Mac Pro OS X 10.9.2  with iTunes 11.1.5. Does anyone know why this happens, and what I can do to prevent it from happening again?

    Hi Amy:
    Sorry that the Color Setting idea didn't do the trick. Since the occurrence is separate, that is, seeing one color view using Elements and a different color view using email view. I still suspect this area.
    Calibrating a monitor to me (as the saying goes), is easier said than done. You may want to do a web search using Calibrate Monitor, or similar search words. This will find some interesting websites on calibrating monitors you can read and try out. If you do change some settings, write down what your original settings are before hand, so if you make it worse, you can go back where you started.
    There are two areas to calibrate the monitor.
    1. Using the monitor controls on the monitor itself.
    or/and
    2. Using the graphics card (software) control. Which is normally found (Win XP) DISPLAY PROPERTIES>SETTINGS>ADVANCED> then the TAB with your graphics card name.
    3. Actually there is a third one, which uses a very expensive device that connects to the monitor. At the moment this method escapes me. Mainly used by professionals and serious photo editing people.
    Good Luck!
    Tony

  • PL/SQL region. query get rounded up when displayed using htp.p procedure.

    Hi,
    I tried to apply the above code, but the coordinates don't seem to come out right.
    When I test the following query:
    select c.employee_id
    ,t.X
         , t.Y
    from employees c, TABLE(SDO_UTIL.GETVERTICES(c.geom)) t;
    It works fine. Don't let the spatial component discourage you. The output are just two coordinates, just like normal sql. I tested the output in a Report page.
    When I display the columns via an alert, instead of ( 43.907787,-79.359741) I get (43,-79).
    for row in employees loop
    htp.p('
    alert('||to_char(row.y)||');
    alert('||row.x||');
    Any idea how to get around this?
    ThanX,
    Pim

    Hi,
    I tried to apply the above code, but the coordinates don't seem to come out right.
    When I test the following query:
    select c.employee_id
    ,t.X
         , t.Y
    from employees c, TABLE(SDO_UTIL.GETVERTICES(c.geom)) t;
    It works fine. Don't let the spatial component discourage you. The output are just two coordinates, just like normal sql. I tested the output in a Report page.
    When I display the columns via an alert, instead of ( 43.907787,-79.359741) I get (43,-79).
    for row in employees loop
    htp.p('
    alert('||to_char(row.y)||');
    alert('||row.x||');
    Any idea how to get around this?
    ThanX,
    Pim

  • Issue with XML post when port used with server name

    Hi Guys,
    We are currently using an agent on our application servers which puts a server in "inservice standby" if the CPU load on the system goes above 75%. This agent is using an XML post on the CSM to achieve this and put the server back inservice using XML post as well.
    Currently we are trying to use the same agent for another application which has a port number defined as well and it does not seem to work.
    To give an example where it works:
    serverfarm TEST
    nat server
    nat client TEST
    real name BLABLA
    inservice
    The example where it does not work:
    serverfarm TEST
    nat server
    nat client TEST
    real name BLABLA 50000
    When we get the server name via XML we see that CSM returns the name as BLABLA: 50000 however using the same in the script does not work.
    Would someone know how to put the port number in an XML script so that the CSM understands which server need to be changed.
    Thanks,
    Murtaza

    It would be some thing in line with the following example
    <?xml version="1.0" ?>
    The DTD for CSM XML will let you know what tags and attributes are available to use:
    http://www.cisco.com/univercd/cc/td/doc/product/lan/cat6000/mod_icn/csm/csm4
    _1_2/icn/xmldtd.htm
    HTH
    Syed

  • OS 10.3 works with Linksys but when startup using 9.2.2 won't work

    I apologize if I'm on the wrong forum. I don't know if what I'm asking applies to Express or Extreme--all I know is that I have an airport card in my laptop. I have a wirless airport card in my old titanium G4 and it works fine with my Linksys SRX router when I'm running 10.3. When I start in 9.2.2 (which I have to do to run the version of Virtual PC I own) I can't seem to get the computer to talk to the Linksys. I set appletalk to airport and TCP/IP to airport and DHCP but when I type in the password for the router it says it can't go to the network. Any thoughts? I used to use the 9.2 side with an airport base station that has since died and I hadn't used the 9.2 since I bought the linksys. Thank you.

    I hope I'm doing this right. I forgot to mention
    that I am using WPA personal
    This is why.
    You need to be running 10.3 or later to connect to a WPA encrypted network, a Mac running OS 9.22 will only be able to connect to a WEP encrypted network.
    iFelix

  • What to do with Time Capsule when not using for Wireless Internet

    I previously connected my Time Capsule to my fiber optic router but in my no home this is no longer needed as the cable TV company now provides 160 MPS Internet in a router that contains a wireless router built in. It works fine.  My computer is now connected wirelessly to that router (too far to take advantage of the wired connection).
    Therefore I want my Time Capsule to just be connected to the computer for backups.  I gather I have to connect it via Lan and make sure it does not transmit r receuve wirelessly. In fact, other wireless computers in the huse occasionally try to log into the old Time Capsule PPoE settings, so I want to erase them and start fresh.
    This seems to be similar to what I want t do, but I want to make sure and ask:
    https://discussions.apple.com/message/8256674#8256674
    If this is not correct, can someone advise.
    By the way, I have a first generation Aiport Express that I hope to use with my new cable router (modem?).  I assume it will work as it did with the Time Capsule. Purpose is for Airplay with an audio system.
    Thanks!

    Thank you for your replies. I really appreciate it.
    To answer your questions in order, but first I should mention that due to work reasons, I will be away from my computer until Friday night Japan time, or Friday AM US time.
    Anyway, probably better I go slowly,as I tend to get overwhelmed by technical things.
    1) You said:  "The TC does NOT require an Internet connection for network connectivity. You DO have to connect the TC by Ethernet to the Fiber Optic router in order for it to gain network connectivity AND to allow network clients to access it."
    -->Ok, this is in reference to my Time Capsule and the previous network n myold apartment.  But your next question makes me wonder:
    2) "Is this Motorola device the one that replaced the Fiber Optic router that you mentioned in your original post? What is its model number? Do you have the TC connected directly to it by Ethernet?"
    Ok, this is what I have:
    Wall--> Cable modem with wireless (Motorola SURFboard SBG6580J Wireless Cable Modem Gateway.)
    Other Room  IMAC connected wirelessly to Cable Modem (no Ethenet connection to it since there is no jack and too far to run a cable (permanently--I can do for setup if needed)---> connected to TC and Time Capsule is backing up ok. Time Capsule is also not connected to the Modem
    3) "Since you will only want to use the Time Capsule for Time Machine backups, I understood that you wanted to disable its wireless network. If this is still the case, the Express would need to be configured to join the wireless network provided by the Motorola wireless router."
    Yes, This is what I am wondering. Do I have to connect it by LAN to the Motorola?  A few times, when it was just plugged into the Wall, my Mac airport utility found but them could not connect to my Express. maybe because I did not configure it to work with the Motorola as you say.
    4)
    "By default the Express will broadcast its own wireless network with a network name of something like: Apple Network NNNNNN. You would need to connect to this network with your computer prior to attempting to access it with the AirPort Utility. Another option would be to temporarily connect it, by Ethernet, to the Motorola router during its setup phase. Once completed you can move it to the desired location."
    Ok, this confirms what I guessed.  Connecting the computer to the Expressby Lan?  Is that what you mean?
    I do understand the second option---connecting the Express to the Motorola. 
    If that is right, I can try that.  Do I need to do anything other than connect it?
    I will be able to try this Friday or Saturday I hope.
    Once again. thanks for all your help. Really appreciate your taking the time to explain it.
    paul

  • Can I link a query with an Excel file without using universe designer?

    Post Author: nicmac3030
    CA Forum: WebIntelligence Reporting
    I have an Excel file that contains a list of 200 seller codes.  The list is updated on a weekly basis.
    I need to create a query in Webi that shows ONLY those records in our main table that match one of the seller codes on the Excel list.
    Is there an easy way of doing this?  I don't really want to hassle our universe designer guy with a new file to import every week.  But if that's the only way to do it, we will have to.
    Back in BO v5 we used an Excel macro to add all the codes into a long text string with commas & pasted that into the query designer.  Unfortunately there are many queries that need to be updated, so hopefully there's a way to automate this.
    Thanks for your help.  Cheers, Nick

    Post Author: jsanzone
    CA Forum: WebIntelligence Reporting
    Nick,
    You don't mention what version of BusinessObjects that you are using.  If you are going to adopt XI 3.0 sometime soon, then you will have a definite capability of doing what you want with a new product included in 3.0 called "Rich Client".  At this moment I can't think of any other way to achieve what you want other than RC.  You can read more about RC at the Business Objects docs web site, here: http://support.businessobjects.com/documentation/product_guides/boexir3/en/xi3_web_intelligence_rich_client_en.pdf

  • Attempting to construct LDAP query with getobject fails when passing string

    Hello.
    I have a very simple question. I am trying to pass a constructed LDAP string to getobject and it fails, but works otherwise.
    ldapStr = chr(34) & "LDAP://" & "CN=Security Group" & ",OU=Security Groups,OU=SomeOU,DC=subdomain,DC=domain,DC=com" & chr(34)
    Set objGroup1 = GetObject("LDAP://CN=Security Group,OU=Security Groups,OU=SomeOU,DC=subdomain,DC=domain,DC=com")
    Set objGroup2 = GetObject(ldapstr)
    objGroup1.GetInfoobjGroup2.GetInfo
    "objGroup1.GetInfo" works, while objGroup2.GetInfo fails with "(null): Invalid Syntax". I have tried escaping using a backslash (\) before the commas and forward slashes but same thing. I was hoping someone might be able to
    explain why getObject is not allowing me to pass this string when connecting via LDAP.
    Thanks for your help.

    Or this:
    strGroup="Security Group"
    ldapStr= "LDAP://CN=" & strGroup & ",OU=Security Groups,OU=SomeOU,DC=subdomain,DC=domain,DC=com"
    Just cat the strings.  Don't add extra quotes.
    ¯\_(ツ)_/¯

Maybe you are looking for

  • DISAPPOINTED AT THE LACK OF CUSTOMER SUPPORT IN TR...

    Hi all, I want to share my BT experience with you.   I have been up to now a happy BT Infitinty customer.   At the start of July I informed BT of a house move at the end of July.  I happily signed for a new package, NO BRAINER as far as I'm concerned

  • Problem in assigning Infoobjects to Catalog using BAPI_IBOJ_CHANGE

    Hi Gurus, I am creating infoobjects using BAPI_IOBJ_CREATE and assigning the created infoobjects to a catalog using BAPI_IOBJ_CHANGE. But, while assign the info objects to a catalog, if the catalog already contains infoobjects they get unassigned, an

  • Vista with Windows 7 upgrade

    If I get a Windows 7 upgrade disk and install it over my current Vista, and then upgrade to Lion, what will I have to do if I ever need to reinstall Windows 7 since I will only have it as an upgrade disk? I don't want to buy a full version for the on

  • Program to upload contract price changes to inforecord

    Hi Friends, Is there any standard program available to update changes in contract price to info record I know if you put info update indicator in contract system will update provided you have EVO parameter set in id But i would like to know if we can

  • HTTP Upload Problem

    I have an JSP application that uses a JSP component to upload files onto any location on the web server. The component has a saveAs method to save the file on the web server. This functionality works great on the iFS Apache Server(solaris). It will n