Group by problem with count

I am trying to figure out the number of charters taken by each customer. I can get it to work fine if I just count the trip id and group by the last name. The problem is that I want to display my customer's full names and keep getting errors when I try to group by the concatenated field Any suggestions? Here is the code I am using:
Select count(charter.char_trip)"Total Charters",
CUS_FNAME||' '||CUS_LNAME "Customer"
From CHARTER, CUSTOMER
WHERE CUSTOMER.CUS_CODE = CHARTER.CUS_CODE
Group by "Customer"
;

try using a subquery.
  select cc.customer "Customer",
         count(cc.char_trip) "Total Charters"
    from (select charter.char_trip,
                 CUS_FNAME||' '||CUS_LNAME
            From CHARTER, CUSTOMER
           where CUSTOMER.CUS_CODE = CHARTER.CUS_CODE) cc
  group by cc.customernote: untested

Similar Messages

  • Receiver determination - Xpath expression problem with count

    I am working with a scenario where I pick up records from a JDBC connection and if the number of records I pick up is less than a certain number I want to call a webservice.  If it is greater than the number I want to write out a file to be processed by a different process on the receiving end.  I have created the receiver determination condition with the following conditions:
    (/p1:MT_HOG_Data/row[count(row) > 3] EX)
    (/p1:MT_HOG_Data/row[count(row) <= 3] EX)
    The integration is always processing the second condition no matter how many records come in.  I have tried with and without the multiline option.  Can anyone help with this?
    I have searched through the forum and checked the following links without any resolution:
    http://wiki.sdn.sap.com/wiki/display/XI/XpathConditioninReceiverDetermination
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/ab/13bf7191e73a4fb3560e767a2525fd/frameset.htm
    /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
    I can't find any examples where a count of records is checked in the expression editor.  Thanks in advance for any help.

    You can not use the EX operator in that case, because that is used only for node existence checks, not for value checks.
    Do you have a row number in your structure ? Then you could write the xpath expression with that counter tag and value
    Example: you want to send to receiver A if count > 3, else to B:
    you set  /rowNumber EQUAL 4 for sender A
    and /rowNumber NOT EQUAL 4 for sender B
    The condition is applied to the whole document. If one of the node/values are true for that condition, then the whole condition is set to true.
    Problem with that is that the second condition also will be true because nodes for that condition will be found
    better would be to have a rowcount tag in the structure. If that is not possible, you can use the "Enhanced Receiver determination" where you can define a mapping which determines the receivers. There you can do anything complicated you want.
    CSY

  • SCCM 2012 Update Group inconsistency Problem with Red marked Updates

    Hi everybody,
    we have a big Problem with our SCCM 2012 R2 CU3 Enviroment, regarding of Update Groups which got out of sync.
    we have a SCCM Site Infastructure with one CAS and 4 Primary Sites and on every Site is the SUP Role installed.
    I don't know when this failure occours but i think it was after the CU3 Installation. The Installation itself went smooth without any Errors or Warnings.
    The Problem is as following. We have some updates in Update Groups (all of them are Core XML Updates) which are out of sync and marked red as an invalid Update on 2 Primary Sites. On the CAS Site and the 2 other Primary SItes they are marked as green (downloaded
    yes and deployed yes)
    We have no Replication issues regarding the Replication Status (everything is synchronized to 100%) and the Replication Link Analyzer does also show no Problems at all.
    I now deleted the Deployments and the SW Update Group waited until the replication was fine and created a new one and downloaded these patches on one of the Primary Sites which had shown this Failure.
    The Result was not good. It looks like before. On the CAS and 2 Primary Sites the Deplyment is shown as downloaded but on the other 2 Sites the Status is again Downloaded=no.
    Does anybody have any idea what to do now ? I checked objmgr.log and rcmctr. log but found nothing what shows me the way in the right direction.
    Thx for your time, and it would be fine if anybody can share knowledge about this failure and how to fix it.
    All other Ideas are also welcome.
    Thx a lot in advance and have a nice bug free day :-)
    Bastian

    Hi,
    Please try to manually synchronize software updates from the CAS and monitor the WSUSCtrl.log, WCM.log and wsyncmgr.log on the CAS and Primary sites.
    Best Regards,
    Joyce
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Problems with counter in renaming interface not maintaining consistency across multiple libraries

    Happy New Year, all.
    We have a problem in Aperture that I was curious if others had, and I'm hoping somebody has figured out a workaround they will share with me. Originally, we used Aperture and it had one huge library for our different types of photography. We had to change away from that setup because if there was a problem it would take ages to troubleshoot a ~500GB library and perform actions like rebuilding the library. We didn't want to do this, but splitting into six libraries has improved the speed in general and has made rebuilding smaller individual libraries quicker.
    We shoot a lot of photos and want each photo to have a unique number (along with a custom name). We set up a rename option in Aperture that has "Custom Name_Counter" and set counter to be six digits. The problem this seemed to create is that the counter in the rename function doesn't produce a unique number consistently across libraries. If I'm in library A, and I rename a batch of files, the counter will go up and remember its last number as long as I stay in Library A. The minute I switch to Library B, the number is at where it was the last time I used Library B. This indicates to me that the preferences travel with the library.
    Does anybody know a way that I can have a global preferences file, rather than a library preferences file? It seems it maybe used to be this way, but one of the version 3 upgrades forced me to delete a preferences file for the Facebook bug a couple of version 3 subversions ago.
    On a different note, another problem with renaming is that it is so slow. Renaming master files for even 100 or so files takes minutes. Does anybody else have this happen? Sometimes it's faster, but I haven't been able to figure out a pattern to this.
    I've submitted feature requests for revamping the renaming interface for Aperture for at least a couple of years. It never seems to improve. iView Media Pro, a program I used six years ago, had a great renaming setup and I wish Aperture
    Maybe it's time to reinstall Aperture. I bought it on disc, so it's not through the App store. Does anybody have experience reinstalling? I would, of course, like to keep keywords and other preferences.

    hallerphoto wrote:
    Machine is a Mac Pro dual quad-core 2.16 GHz.
    I am unaware of a 2.16 GHz Mac Pro tower. Are you referring to a Macbook Pro or to an iMac? Or is it a configuration I am just unaware of?
    My concern is that it seems that you may be making major workflow compromises that might be better dealt with by hardware changes as feasible. E.g. most 2.16 GHz Mac CPUs are about 1/6 as strong as a top Mac Pro today or about 1/4 as strong as today's Macbook Pros, and that has huge implications on Aperture performance.
    Also, graphics processors of the 2.16 GHz era were ridiculously weak compared to modern Macs. Aperture has historically performed best with strong GPUs (e.g. the strongest G5 towers would not run Aperture without a GPU upgrade). If you stay with the existing box a GPU upgrade may (if feasible) be in order.
    You did not mention RAM, which has defining impact on Aperture performance.
    Even if no hardware upgrades are made, it is useful to know what hardware performance bottlenecks may exist. So some questions:
    • Which Mac(s), exactly?
    • Which OS version and which Aperture version?
    • How much RAM is on board?
    • If a Mac Pro, which GPU card is in use?
    • What mass storage (hard drives and SSDs), how connected and how full?
    Thanks.
    -Allen

  • Problems with counter

    Hello everybody.
    I have a problem with a counter used in counter-based maintenance.
    I'm sure that the characteristic was created correctly, so I think the problem is in the mesauring document.
    When I update the counter with a value like the previous(I do that so that scheduling dates will change), the counter resets itself, and at the next updated the the field "Total Counter Reading" is empty.
    Where is the error?
    Thanks advance.
    Viviana

    Hi,
    Though your query is not very clear, what I have understood is that you are creating a mes doc. for which the value already existing is X. You are creating a new meas doc.. with the same value X, your difference should be '0' and the total counter reading should remain as X only. Is it not happening in this way ?
    Regards,
    Bala.

  • Timing problem with counting edges

    Hello!
    I use a NI PCI-6221 DAQ card with NI-DAQmx to count edges of TTL pulses for a spectrometric application.
    It is extremely important that I count the pulses for a well-defined period of time. Typically, I want to count the edges that reach the counter in the period of 400 milliseconds.
    Normally, this works quite well, when I use a WHILE loop that reads and restarts the counter every 400 milliseconds. Things change when the PC I run the VI on has other programs running in the background. Expecially computing-time intensive programs delay the 400 milliseconds of the WHILE loop for up to several 100 percent, resulting in an wrong counter read.
    I tried to use a timed WHILE loop but this din't change anything, regardless of the timimg source (onboard clock or PCI-6221 counter) I applied.
    Has anyone encountered similar problems and found a solution? Isn't there a possibility to control the counting time by hardware?
    Thanks in advance!
    EresthorMessage Edited by Eresthor on 04-07-2005 08:17 AM

    Hej Lynn,
    of course your idea works, thank you. It works extremely well this way, too.
    My problem with this approach is that I need both counters on the PCI-6221 to count data from my spectrometer simultaneously on two channels. That's why I would like to trigger the counter in a different way, for example with a clock.
    Is there no way to trigger the counter with the timebase of a hardware clock on the card? Or ist there another possibility without wasting a counter?
    Eresthor

  • Should Device Test find problem with counter?

    Hello!
    I am have one problem with PCI 6251 board. It seems to me that something happening with counter 0. Several days ago everything was ok, but now any counter output does't appears on its terminal (on BNC 2120 block). When I see at the signal from it on the oscilloscope, I can see right shape of the pulses, but about 10 mV amplitude. Everyting is perfect with counter 1 output.
    OK, I run the self-test and it is passed. I have tried to reset the devce and try again - the same result. Self-test is passed, but counter 0 seems to be not functioning.
    Is it another possibility to check the device?
    Thanks in advance!

    Hi Baturin,
    It is quite possible that your BNC connector has problems. If you were able to route the output of Counter 0 to a PFI line, and able to see a good signal, then your terminal block is at fault. The first things you should look for are the pins. Sometimes, the pins on the connectors are bent, and thus do not provide a reliable contact. Second thing you should look for is any external damage. Finally, use the test panel in Measurement and Automation Explorer (MAX), in the counter tab to test the card (which is probably what you are already doing).
    If all of the above still seem to confirm your initial diagnostic of a bad BNC connector and a good M series card, then please call us. We would then do a final troubleshooting before sending your BNC connector back to be repaired.
    Thank you and best regards,
    Nathan
    Applications Engineer
    National Instruments

  • Problems with counting the forum points?

    Hello sdn team,
    i recogized that i got some points in forum threads but they are not added to the summary points on the business card. Here is a sample:
    Difference between EAM and MAM
    Are there any problems with the pointing system?
    Regards
    Frank

    i had similar kind of issues more than once and reported the same to [email protected] which was quickly fixed.
    mail [email protected] along with the link to the thread and your account id.
    Regards
    Raja

  • Problem with Count

    In Essbase, is it possible to perform a counting function ( one that is similar to the COUNT in Oracle ). For example, I want to:1. Get a count of all the interception with Forecast Measure = 1002. Given a group of interceptions, get a count of all the interception with Forecast Measure = 100If we can't do this in Essbase, we may have two other solutions:1. Perform the count by going through all the interceptions on a one-by-one basise, but it is going to be too too slow2. Have all the values of the Forecast Measure to be stored in Oracle as well. Whenever a value in the Forecast Measure change, the Oracle table automatically gets updated. In Oracle I can do COUNT in SQL. However, I don't know what is the most effective way of performing such kind of data synchronization between Essbase and Oracle.Anyone gets an idea?Thanks,Anne

    To count the rows for the filtered data, you need to fo with actual table nly. May be, you need to look at the index on Column_name, however, that would not help you here as you are using % ''val'' %(not sargable). 
    An index on the column would certainly help, assuming that the table has quite a few more columns than this column. Scanning the index is faster than scaning the index, since it's fewer pages to scan.
    Full-text index that was suggested by someone else, can be a great improvement, but that requires that value searched for is a whole word, or at least start of one.
    But overall Queriessqlserver need to explain the problem in more detail, and particular why (s)he is running this query, to get any meaningful suggestions.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Problem with Counter in Query

    Hi Experts,
    There is a problem in my query output.
    I have a CKF for sales documents number created with replacement path which gives the correct count of number of Sales documents.
    But the req here is to create two more counters which will be counting the passed and failed count with reference to other KF1 (the value of this KF can be 0 or 1).
    i.e. If the KF1 value is then failed count would be 1 .
           else passed count would be 1.
    I have used the Replcement path variable created for Sales Document count.
    For failed count the CKF formula which I have created is: (Sales Order Count ) * (KF1<>1)
    Which gives the right result but as soon as I remove the drill down , instead of aggrading the total results, failed counter still shows 1 which is incorrect.
    Could any one please help me out.
    Regards,
    BW User

    hello,
    try using exception aggregation as total and reference char as the one which u have reomved from drilldown.
    Regds,
    Shashank

  • Local calendars group ​disappeared - problem with saving in the local calendars group

    Hello, I ​have been working with calendars. ​​I wanted to add ​a ​new calendar to ​the iCloud calendars group or to local calendars ("On my iPhone").​ ​
    I found that when I am switch​ing​ off the iCloud for calendars, the iCloud ​calendar ​group ​disappears and don'​t create the ​local​ storage ("On my iPhone"). ​I ​did exactly the same on the iPhone 4S, and​ it ​create​d the​ local group. I don't know ​why it​ is​ different ​on iPhone 5, ​especially as I was using iOS 7.1 ​on both.
    Has ​anyone else had this problem before? Do you know how to restore my calendar to the local storage?
    Thanks for help.

    Solved this:
    Turns out that we now require at least "List" permissions for "Everyone" for the root of the partition where the User profiles reside.
    This was not the case on our previous images.
    Hopes this helps someone else.

  • User's Group Membership problem with enterprise domain

    Hi
    I have some problems synchronizing Active Directory in LiveCycle ES 8.0.1.
    I'm able to import the users and groups from an active directory to a enterprise domain... but the asociation user to group is not keeped.
    The problem could be why the DN of users is different to the DN of the group?
    the DN users is something like this:
    OU=CED,OU=CDC Utent,DC=house,DC=lan
    and the DN of the group:
    DC=house,DC=lan
    Thanks

    Ok, I think that is not DN value the problem... I tried with another active directory and the association user to group is keeped! But why?
    In the users details of active directory that doesn't synchronize well I have 2 more attribute:
    dSCorePropagationData
    profilePath
    But really I don't understand where is the problem. Maybe the version of Active Directory?
    Does anybody else have this weird issue?
    Thanks.

  • 6014 board problems with counter 0

    Hi all,
    I'm working on a project with a 6014 board and Real-Time Windows Target of Matlab. I need to interface the signals from two incremental encoders. The qudrature signals are converted into a direction signal and a pulse train signal with the idea to feed them to the counters of the board, configured as bidirectional counters in up/down mode. The connections are as follows:
    For Counter 0 - the pulse train signal is fed to PFI8, and the direction signal to DIO6.
    For Counter 1 - pulse train signal to PFI3, direction signal to DIO7.
    The problem is that Counter 1 is working properly, while with the same signals fed to Counter 0 what I read makes no sense. The counter increments by very large values at once and behaves erraticaly.
    I'm seeing this behavior on two different boards.
    Any help please!
    Thanks in advance!
    Stanislav

    Hi Stanislav,
    My recommendation will be to install Signal express (it is a free application that you can use to generate or aquire data) avaialble at the following location https://lumen.ni.com/nicif/us/evalsignalexpress/content.xhtml
    and DAQmx driver available at the following location http://joule.ni.com/nidu/cds/view/p/id/3423/lang/ro
    After you install the two software mentioned above, launch Signal Express and it should be straight forward how to program because it is a configuration based programming. You can use the menu to generate a train of pulses on counter 1, also you may use an oscilloscope to validate the generation part and than use your software to acquire on CTR0. If you still have the problem to acquire on CTR0, you can reverse it and use Signal Express in the acquisitioin part.
    Best regards,
    I.R.

  • Problem with counting number of clic with initialize mouse vi

    Hi,
    I want the vi stops when the user clics several times with the mouse. I use initialize mouse vi instead of event structure for other reasons (I can't use it).
    I intented to count the number of clics and when this number of clics occur, the vi stop. But the vi don't work, it stops at the first clic although when i highlight execution it seems to work as I want.
    I send here the vi.
    If someone could help me, thanks in advance.  
    Attachments:
    number of clic.zip ‏24 KB

    Hi,
    The problem is the execution time, if you push the mouse button your program will execute number of times before you lose the button agian. Even if you push it realy fast.
    I made some changes to your code there i wait until button is released befor continuing.
    Regards
    /Thomas
    Attachments:
    number of clic Folder.zip ‏20 KB

  • Problem with count query

    I am connecting to the excel and running the following query:
    Select Count(*) from [RIF$];
    I is working fine and giving me total count of rows
    Now when i try the following version of count
    Select Count(Distinct Status) from [RIF$];
    where Status is a column name.
    It is giving the following error:
    java.sql.SQLException: [Microsoft][ODBC Excel Driver] Syntax error (missing operator) in query expression 'Count(Distinct Status)'.
    Pls help me
    its as always urgent

    This shouldn't execute in the quiery analyzer too, you don't have a java problem. I am not sure this is the optimal but you can try something like:
    select count(c_id) from (select distinct pcid c_id from contragent) cntr HTH
    Mike

Maybe you are looking for

  • Audigy ZS2 probl

    Motherboard: CPU Type AMD Athlon 64, 2500 MHz (0 x 250) Motherboard Name Asus A8V (5 PCI, AGP, 4 DDR DIMM, Audio, Gigabit LAN) Motherboard Chipset VIA K8T800Pro, AMD Hammer System Memory 024 MB (PC3200 DDR SDRAM) BIOS Type AMI (/03/05) Display: Video

  • Solaris 10 partitioning

    I have a Sun Blade with 2048 MB ram running Solaris 10. I performed a clean install of the 11/06 release last month. I allocated 6 GB for the / partition, 750 MB for swap (+ 150MB in a separate, stand-alone file using swap -a), 3GB for /export/home,

  • Hiding button after successfull call to databse procedure

    Hi, This is my first post and my first APEX app. I have a submit button that calls a database procedure passing parameters from the form. The procedure then updates the database record and the page shows the update which means its successfull. Howeve

  • Itunes not displaying library of old ipod with uptodate software

    Can anyone help,I have an original 20gb ipod which has update to date software but I cannot see my library so i cant delete anything off my ipod?

  • Hp scanjet 3800 in mac OS X 10.9

    how to install hp scanjet 3800 in mac OS X 10.9