Not getting the right quantity in select

Hi,
My company stores each week's transaction in one dbf table, thus, creating around 53 tables per year. I try to move the tables into one big table (bigTable) in mysql. I created a Java program to select the data from dbf (visual foxpro dbf driver) and insert into mysql using JConnect. After I finished inserting into mysql, I used Visual Foxpro and I do a:
SELECT sum(quant) from week532000.dbf
and obtained 52843.6, which I considered it the correct result.
* Note that 'quant' is of type Numeric in dbf.
However, when I do this with mysql client:
SELECT sum(qunt) from bigTable where date_ between '2000-12-25' AND '2000-12-31'. I obtained 52977.6, which is different from the original result.
To troubleshoot this, I created a small program just to select the 'quant' field and obtained the sum. It turned out that when I ran this program, I obtained a different sum (although I was selecting from the same table):
Example:
sum of quant is 52977.6
sum of quant is 52890.1
sum of quant is 52837.6
double q, qt;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con1 = DriverManager.getConnection("jdbc:odbc:daydata", "", "");
st = con1.createStatement();
rs = st.executeQuery("SELECT quant from wk532000 where quant <> 0");
while(rs.next()){
qt = rs.getDouble("quant");
q = q + qt;
rs.close();
st.close();
con1.close();
} catch(ClassNotFoundException e){
e.printStackTrace();
catch(SQLException e){
e.printStackTrace();
System.out.println("sum of quant is "+q);
Why a different sum was produced each time the code was run? Any feedback is appreciated.

what do you mean timestamp?One of the following is true.
1. You have a field in the database that holds a timestamp (a date and a time.) That is because that is the only thing that databases allow.
2. You have a varchar/char field that has a date in in as a string.
If the second is the case then the problem has nothing to do with java. It is one of the following
- Your migration is not migrating everything.
- Your comparisons are not equivalent in terms of functionality.
If the first then it could still be one of the above problems but it could also be because the timestamp values are not equivalent.

Similar Messages

  • I'm not getting the right "Home" page for Itunes.

    I had my hard drive replaced about six months ago.  I have all my the music that I want on my Iphone 3G and is backed up on my PC.  I haven't synced by Iphone to the computer since the drive was changed. I use another charger that I have plugged directly into an outlet.
    The first picture below is what it should look like AND WHAT I WANT.  The second is what I get when I open Itunes.  I added a CD and a few voice memos while trouble shooting this.  I have around 45 CD's of music on my Iphone and I can listen to them.  When I sync my Iphone, which it does automatically, I can transfer photos to my computer but not vice versa.  I don't get this first picture I get the second.  Also this second screen does not recognize the music I already have on my Iphone and does not put the one CD from the second picture onto my phone.
    I've removed Itunes from my computer and then reinstalled it.  I thought that would solve the issue.  It didn't.  I got the second picture when I connect my Iphone.  Is there some version of Itunes that I don't know about?  Why would I not get the screen in the first picture below?
    Can anyone shed some light on this and help me figure out what to do?
    Any help would be greatly appreciated!!!  THANK YOU!!!

    - plug in your iPhone
    - on your keyboard press "Control" & "S" together, this will bring up the side bar on the left hand side
    - select the name of the iphone underneath "devices"
    Now you should be on the summary page.

  • Analysis not getting the right value off ADM Tool

    Hello people,
    I'm trying to do one difficult thing, but, first of all the simple thing is not working.
    In ADM tool, I have this logic column: avg(Fact_AGR_ESCOPO_MEDIAPPM.MEDIA_PPM_TIPO)
    The physical table that have this attribute is: TFAGR_ESCOPO_MEDIAPPM
    When I do this Search:
    SELECT DISTINCT T3.TIPO_PTB, T2.NOME, T1.MEDIA_PPM_TIPO FROM TFAGR_ESCOPO_MEDIAPPM T1
    JOIN TD_ESCOPO T2 ON T1.ESCOPO_SK = T2.ESCOPO_SK
    JOIN TD_MOTIVO T3 ON T1.MOTIVO_SK = T3.MOTIVO_SK
    WHERE T2.ESCOPO_SK = 1;
    I get this TIPO_PTB:
    Complaint and Não Complaint.
    Now, when I go to the analysis and use the MEDIA_PPM_TIPO att, I got all the TIPO_PTB, not only the Complaint and Nao Complaint.
    Someone know whats is this or how I can search for the problem ?

    The problem was because I'm trying to use some aggregation rule.
    When I put none to aggregation rule, I got only the representation of the DB.
    But now, I have another problem and is my initial problem:
    How can I spread one value to anothers, always getting the last value by month ?
    Example:
    JAN FEB MAR
    10 20 5
    JAN FEB MAR
    5 5 5
    This is what I want. Always spread the last value base on month to the others (The filter is not a good solution because the prompt changes and the last month will not be the same)

  • I can not get the right frequency out of my NI-DAQ 6062E card from Matlab

    Hi.
    My name is Johan and I want to generate an analog square waveform with 5.76 kb/s in frequency with my NI DAQCard-6062E from Matlab.
    When I run in Matlab the program below, I get the frequency of 5.747 kb/s on the output channel (even thou I have chosen 5.76 kb/s). When I try to change the sample rate, to higher values in Matlab, I get the same frequency until I choose the sample rate to 5.79 kb/s. The output signal is in that case is 5.813 kb/s.
    So my problem is that I can't get the exact frequency of 5.76 kb/s.
    How do I solve this.
    Thankful for help.
    Best regards, Johan
    Program in Matlab:
    clear all
    openDAQ=daqfind; %Detect any open DAQ channels
    for i=1:length(openDAQ), %Close any open DAQ channels
      stop(openDAQ(i));
    end
    ao = analogoutput('nidaq',1); %Create an object for analog output
    addchannel(ao, [0 1]);
    set(ao, 'SampleRate', 2*5760); %Here the sample rate is specied. 2*, because to get right samplerate
    y=[80,-80] %Sets theoutput values to 80 and -80 (As -1 and 1)
    putdata(ao, [y' y']); %Sends the values to out buffer
    set(ao,'RepeatOutput',inf) %Repeats sending in infinity
    set(ao, 'TriggerType', 'Immediate'); %Choose trigger to immediate, because sending values shall occur driect after start command.
    start(ao);
    %stop(ao)

    Hello Johan!
    Bad news I am afraid….
    I assume you are using the Data Acquisition Toolbox from the Mathworks and when it comes to support on that interface I have to advice you to contact the Mathworks for assistance. We don't provide any support on their data acquisition interface since we have nothing to do with it.
    Sorry for the inconvenience this might cause you.
    Regards,
    Jimmie A.
    Applications Engineer, National Instruments
    Regards,
    Jimmie Adolph
    Systems Engineer Manager, National Instruments Northern Region
    Bring Me The Horizon - Sempiternal

  • Q:Date link not getting the right date in calendar

    Gang,
    I have enabled the day link on my calendar so the user can click on the date in the month view to get to a form page where they can add records.
    My day_link looks like this:
    f?p=&FLOW_ID.:2:&SESSION.::&DEBUG.:2:P2_TRAINING_DATE:#TRAINING_DATE#
    Where P2_TRAINING_DATE is the DATE I'd like to populate on page 2. The variable name that holds this date is called P2_TRAINING_DATE.
    If I hoover over the daylinks they display very strange dates and also if I click on the link the dates are wrong. For example if I hoover over 01-May the URL in the bottom of my browser displays the correct date but if I hoover over 02-May it displays 05-May instead.
    What am I missing, should I not use the #TRAINING_DATE# variable?
    Oh, this application is running on apex.oraclecorp.com so it's version 3.1.
    Cheers,
    Andy

    Hi Andy,
    Change the day link to pass #DD#/#MM#/#YYYY# (UK format, so change if another format is required).
    This will pick up the date from the calendar rather than your data.
    Andy

  • Hi Guys,,I am not getting the right output?Plz help

    Hi Guys,
    Here is my code..
    ELSEIF p_versb  = 'W2'.
        CONCATENATE lv_perxx '08' INTO lv_date3.              (20090708)
        CONCATENATE lv_perxx '15' INTO lv_date4.              (20090715)
          SELECT  mseg~mblnr
                  mseg~bwart
                  mseg~matnr
                  mseg~lgort
                  mseg~menge
                  FROM mseg
                  INNER JOIN  mkpf
                  ON msegmblnr = mkpfmblnr
                  INTO TABLE t_temp
                  FOR ALL ENTRIES IN t_firmplan
                  WHERE mseg~matnr = t_firmplan-matnr       (490045,500001)
                  AND mkpf~budat GE lv_date3
                  AND mkpf~budat LE lv_date4
                  AND mseg~bwart IN ('101', '102')
                  AND mseg~werks = t_firmplan-werks.        (werks = 1100)
    Plz suggest where I m wrong ?
    Thanks
    Steve

    Hi,
    Check the
    SELECT mseg~mblnr
    mseg~bwart
    mseg~matnr
    mseg~lgort
    mseg~menge
    FROM mseg
    INNER JOIN mkpf
    ON mseg~mblnr = mkpf~mblnr
    INTO TABLE t_temp
    FOR ALL ENTRIES IN t_firmplan
    WHERE mseg~matnr = t_firmplan-matnr (490045,500001) " Check the matnr value in the MSEG table if it storing with
                                                  "  leading zero's then use the conversion exit to get the leading zero's
                                                  " in  t_firmplan-matnr
    AND mkpf~budat GE lv_date3
    AND mkpf~budat LE lv_date4
    AND mseg~bwart IN ('101', '102')
    AND mseg~werks = t_firmplan-werks. (werks = 1100)

  • Not getting the right posting key..

    hey,
    i am posting accounts payable data using the bapi BAPI_ACC_DOCUMENT_POST.
    my logic arrives at two values
       blart  = 'KG'.
       newbs1 = '21'.
    now how do i pass this to the bapi, which structure , which field, so that i get the posting key as 21 in the GL acct line item ??
    i am always getting 31 and 40 as the posting keys... now i need 21 and 50..
    thnks

    hey Sudarshan, I traced the BAPI and found out that it is the amount being positive or negative along with the doc type that determines what  the posting shud be..so when i set the doc type say as KG and pass a +ve value, posting key 21 is set , for -ve value posting key 50 is set. i was abt to achieve the result by changing the signs for the currency amt..worked..

  • I can not get the bookmarks tab to open

    I just installed firefox on my new laptop. I can not get the bookmarks tab to open. I also can not get the right mouse button to open the copy, print, etc menu.

    Do a clean reinstall and delete the Firefox program folder before (re)installing a fresh copy of the current Firefox release.
    *Download the full Firefox installer and save the file to the desktop<br>https://www.mozilla.org/en-US/firefox/all/
    If possible uninstall your current Firefox version to cleanup the Windows registry and settings in security software.
    *Do NOT remove "personal data" when you uninstall your current Firefox version, because this will remove all profile folders and you lose personal data like bookmarks and passwords including data in profiles created by other Firefox versions.
    Remove the Firefox program folder before installing that newly downloaded copy of the Firefox installer.
    *(32 bit Windows) "C:\Program Files\Mozilla Firefox\"
    *(64 bit Windows) "C:\Program Files (x86)\Mozilla Firefox\"
    *It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    *http://kb.mozillazine.org/Uninstalling_Firefox
    Your bookmarks and other personal data are stored in the Firefox profile folder and won't be affected by an uninstall and (re)install, but make sure NOT to remove personal data when you uninstall Firefox as that will remove all Firefox profile folders and you lose your personal data.
    If you keep having problems then also create a new profile.
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    *http://kb.mozillazine.org/Profile_backup
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Clean_reinstall

  • I Just received the update to iTunes, when I I look at the screen I do not see the normal icons.  When I select movies I do not get the new downloads unless i select the list in the sub file. How do I get backto the old method of seeing and using iTunes??

    I Just received the update to iTunes, when I I look at the screen I do not see the normal icons.  When I select movies I do not get the new downloads unless I select the list in the sub file. How do I get back to the old method of seeing and using iTunes??

    I can tell you that this is some of the absolutely worst customer service I have ever dealt with. I found out from a store employee that when they are really busy with calls, they have third party companies taking overflow calls. One of those companies is Xerox. What can a Xerox call center rep possibly be able to authorize on a Verizon account?  I'm Sure there is a ton of misinformation out there due to this. They don't note the accounts properly or so everyone can see them. I have been transferred before and have asked if they work for Verizon or a third party also and was refused an answer so, apparently they aren't required to disclose that information. I spent a long time in the store on my last visit and it's not just customers that get the runaround. It happens to the store employees as well and it's beyond frustrating.

  • HT204093 the body of my email does not appear to the right when I select a mail message.

    The body of incoming mail messages do not appear to the right when I select a mail message?
    Anybody know how to adjust this?
    Jgm

    Hello!
    Please try these steps: Can't see email message content

  • Concerning Epson Printer 4880: after changing the Ink from Photo Black to Matte Black I'm not getting the Epson Software in Photoshop and Lightroom. I can not select the paper medium, I don't see my profiles. What is wrong?

    Concerning Epson Printer 4880: after changing the Ink from Photo Black to Matte Black I'm not getting the Epson Software in Photoshop and Lightroom. I can not select the paper medium, I don't see my profiles. What is wrong?

    That is priceless!!!  Thanks!  I sure needed a good laugh after spending/wasting hours & days trying to either get my c6280 to give up on its Ink System Failure fixation, or find a decent replacement.  Unfortunately I need the Smart Web Printing feature that I guess only HP has, or I'd try a different brand. And now even HP has very few models with that available.
     My error msg is a little different from those previously stated, but close:  0xc18a0201.  Even tho there were frustrations with my c6280, I did like several of its unique features which are hard to find now under $100.  I hate how HP (& I suppose other brands also) are CONSTANTLY changing models & then of course ink cartridges.
    Oh heavens, I've had the c6280 a whopping 2 1/2 years!   I'm sure they want us poor slobs to have to buy a new one every year & a day!  To say nothing of the exorbitant prices for ink.  And now if this one is really dead in the water, I have SIX unused #02 ink cartridges which I cannot return---I got them in a combo pack, & for some reason have wound up with THREE lite pink & THREE lite blue cartridges, while having to buy extras of the other colors, that ran out before the others!!!   Yeah, & what's with that not being able to print in BLACK if a color runs out????
    Anyway I really loved your essay!   It's a classic!  And says it all!  I hate that we have to be 'slaves' to the electronic 'wonders'!!!

  • HT1535 I do not get the "add to"' button on the right of the screen to add items to my iphone.  Help?

    I do not get the "add to" button on the right side of the screen to add items to my iphone.  Help?

    Please see your other post for an answer.  Thank you.
    Opening PDFs on iPad

  • When I try to Bookmark a new page, I do not get the "Page Bookmarked or Edit This Bookmark" window. I t does place the site into my bookmarks but I have to go to "organize" bookmarks in order to put it where it belongs.

    When I try to Bookmark a new page, I do not get the "Page Bookmarked or Edit This Bookmark" window. I t does place the site into my bookmarks but I have to go to "organize" bookmarks in order to put it where it belongs.

    How are you saving a new bookmark?
    There 5 ways to save a new Bookmark in Firefox, the first 4 should offer to save the new bookmark in a folder:
    1.
    2. Right-click and select Bookmark this Page.
    3. Bookmarks > Bookmark this Page
    4. Double-click the Star that is on the right side of the Location bar.
    4a. (A single-click on the Star will save the new Bookmark to the Unsorted Bookmarks folder, without opening the Edit this Bookmark dialog.)
    5. Drag the website image in the URL bar into the Sidebar view of Bookmarks
    or to the Bookmarks menu bar item and then into the drop-down or onto the Bookmarks Toolbar

  • How can I get the right click to work in firefox -- it works in internet explorer

    how can I get the right click to work in firefox -- it works in interne

    Try the Firefox SafeMode to see how it works there. <br />
    ''A troubleshooting mode, which disables most Add-ons.'' <br />
    ''(If you're not using it, switch to the Default Theme.)''
    * You can open the Firefox 4/5/6/7 SafeMode by holding the '''Shft''' key when you use the Firefox desktop or Start menu shortcut.
    * Or use the Help menu item, click on '''Restart with Add-ons Disabled...''' while Firefox is running. <br />
    ''Don't select anything right now, just use "Continue in SafeMode."''
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut (without the Shft key) to open it again.''
    If it is good in the Firefox SafeMode, your problem is probably caused by an extension, and you need to figure out which one. <br />
    http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes

  • When I changed computers, my IPAD did not get the apps that I had downloaded or purchased. It did get my calendar,music and related items.

    When I changed computers, my IPADII did not get the apps I had purchased when synching. It did get themusic, calendar and related items. I tired Restore, but that did not work. what do you suggest?

    I would try first in iTunes right clicking on your iPad and selecting "Transfer Purchases from iPad". This will add any new downloads from your iPad to your computer. Then click on the iPad and at the top choose Apps and make sure you have "Sync Apps" checked. I hope that helps.

Maybe you are looking for

  • Time Machine/External Hard Drive errors

    I just recently bought a WD passport ultra 2tb to backup my 2008 macbook. I re-formatted the passport as directed by wd support and then downloaded the WD utilities and security apps. I then proceed to set it up with my Time Machine. All of this was

  • Financial Reporting and Workspace 11.x

    Hey, I am new to Financial Reporting. I know that we can not create new Hyperion Financial Reporting reports in Workspace till version 9.x. Is it possible to create FR reports in Workspace in Version 11.x? Any particular process to follow? Thanks, Ed

  • How to Dinamicaly load-save JTree nodes ?

    Hi ! A have one program. Use 1 JTree with a lot of nodes. (200.000-1.000.000. is much) For every node store is sored 7-8 boolan variables, 2long, and 5-6 String variables, whitch legth is 3-20. (Not much).(Information about files avaible somevhere) N

  • WS 2.0 and Skipnode

    Does anyone have any examples of using the Webservices 2.0 and Skipnode to create/update/delete child records? The Oracle Web Services On Demand Guide mentions several times that you can but there are no examples. "For the Web Services v2.0 Execute m

  • ServerRuntimeMBean.isAdminServer()

    Hi, in our portal application, we need to check if the administration server is up. We've got the following method : public static boolean isAdminServerAlive(HttpServletRequest request) { boolean isAlive = false; MBeanHome adminBeanHome = null; // RÃ