Need help on calculating 2 different date

How to check the date 2 different (for example: 18/09/2015 10:28:30), excluding Saturday and Sunday.

And example of the out come in different 4days9hours30min in total

Here you go:

select (select count(*)
    from
          ( select to_char(to_date('09/23/2015 07:13:47 PM', 'MM/DD/YYYY HH12:MI:SS AM')+level, 'DY') as dy
              from dual
              connect by level <= (to_date('09/23/2015 07:13:47 PM', 'MM/DD/YYYY HH12:MI:SS AM') - to_date('09/18/2015 10:28:30 AM', 'MM/DD/YYYY HH12:MI:SS AM'))
          )
    where dy not in ('SAT', 'SUN') ) "Day",
    trunc(mod ( (to_date('09/23/2015 07:13:47 PM', 'MM/DD/YYYY HH12:MI:SS AM') - to_date('09/18/2015 10:28:30 AM', 'MM/DD/YYYY HH12:MI:SS AM'))*24, 24)) "Hr",
    trunc(mod ( (to_date('09/23/2015 07:13:47 PM', 'MM/DD/YYYY HH12:MI:SS AM') - to_date('09/18/2015 10:28:30 AM', 'MM/DD/YYYY HH12:MI:SS AM'))*24*60, 60)) "Min",
trunc(mod ( (to_date('09/23/2015 07:13:47 PM', 'MM/DD/YYYY HH12:MI:SS AM') - to_date('09/18/2015 10:28:30 AM', 'MM/DD/YYYY HH12:MI:SS AM'))*24*60*60, 60)) "Sec" from dual

In addition, check below threads.

The same question is asked and answered repeatedly on the same forum.

Re: Jump for weekend days in SQL

County of days between two dates without weekend

Tags: Database

Similar Questions

  • need help for calculation date

    I need help with this:

    I added successfully a document level script to add the date printed in my document

    this.getField("DatePrinted").value = util.printd ("mm/dd/yy", new Date());

    I now need to fill in a field named "Date" with a date that is 14 days after the date of DatePrinted.

    and I'm lost.

    Can anyone help?

    Get the current date/time

    var d = new Date();

    Add 14 days

    d.setDate (d.getDate () + 14);

    Set a field value

    getField("Deadline").value = util.printd ("mm/dd/yy", d);

    That last part may need to be changed depending on where you place the script. If it's the same script at the document level, the whole thing can be:

    Get the current date/time

    var d = new Date();

    Set a field value

    getField("DatePrinted").value = util.printd ("mm/dd/yy", d);

    Add 14 days

    d.setDate (d.getDate () + 14);

    Set another value of field

    getField("Deadline").value = util.printd ("mm/dd/yy", d);

  • Need help on calculation of complex math in labview

    I need help in being pointed in the right direction.  I have an old piece of lab equipment that I have linked to the labview.  In order to send commands to the hardware, I have to calculate a checksum.  The checksum algorithm requires me to take alphanumeric, convert them to binary, perform a binary addition, perform an Xor, hide some numbers and convert the resulting binary string to an ascii character.  LabVIEW has the capabilities to do it on its own, or should I look for to connect to something like an external dll?

    I have Visual Studio 2008 and some previous experience in VB, so I think I could write a program that would make the calculation, but don't really know exactly what kind of project (dll, etc.) is preferable.  Are there specific for the dll parameters so that labview can use it.  I see an example for C++ to Visual Studio 2005, but that's as close as I can get.  I only know VB, c#, or C++

    Can someone tell me please in the right direction?

    Tron

    You essentially have some quarters of logical work and ANDS.

    Check version 2.

    /Y

  • Need help with query between 2 dates

    Hello

    I did not SEE in a long time and need help with a simple query.

    I have a table of DB access with 3 fields, name, date and number

    What I want is to create a query to retrieve all the names between 2 dates

    When I ask the date field, the results are showing in this formats 2013-07-12 00:00:00

    Here's my query

    < cfquery datasource = 'mydb' name = 'test' >

    SELECT name from myTable

    where edate between ' 2011-01-01 00:00:00 ' AND ' 2013-01-01 00:00:00 '

    < / cfquery >

    < cfoutput query = 'test' >

    #name #.

    < / cfoutput >

    What I get is this error

    ODBC = 22005 (assignment error) error code

    [Microsoft] [ODBC Microsoft Access driver] Type mismatch of data in the expression of the criteria.

    Don't know what I'm doing wrong here.

    Please let me know.

    Thank you

    SELECT ename

    FROM MyTable

    WHERE edate BETWEEN

    AND

    #ename #.

  • need help with hex and handling data extraction

    Hello

    I have able to transmit hexagonal commands on the serial port of my camera and receive responses in hex him successfully. I was able to confirm this by changing the display format to the spell for the control and the indicator. Now, I want to store the portion of the hexagonal received data and use it in my future orders. Example of received data as below:

    0001 1100 0010 E002 6 93 4D7E 2C4D AA66 F00D

    The red blocks will be incorporated in the next command so that when I sent this command it will look like this:

    F00D 0014 2000 0003 0000 0020 77AF E002 6 93 4D7E 2C4D

    In short, send the command and get response, extract and store data in red blocks, then send different control that contains the data that is stored. Everything is in hexadecimal format. Question is how can I extract/store the bytes wanted to and then rebuild a hex command containing these bytes? Can I convert it to normal string, byte array, or hexagonal table? If we use the latest methods of 2 conversion, I need to ensure that the zeros are not lost.

    I enclose my VI. Please take a look and help to provide a solution.

    Thanks in advance.

    Here, s what I had in mind (LabVIEW 2010):

  • need help with query can find data back please help.

    Hi guys I have a table such as
    CREATE TABLE "FGL"
      (
        "FGL_GRNT_CODE" VARCHAR2(60),
        "FGL_FUND_CODE" VARCHAR2(60),
        "FGL_ACCT_CODE" VARCHAR2(60),
        "FGL_ORGN_CODE" VARCHAR2(60),
        "FGL_PROG_CODE" VARCHAR2(60),
        "FGL_GRNT_YEAR" VARCHAR2(60),
        "FGL_PERIOD"    VARCHAR2(60),
        "FGL_BUDGET"    VARCHAR2(60)
      )
    and I have a data as such
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','11','1','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','10','1','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','1','0');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','14','200');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','10','14','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','10','2','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7470','4730','02','10','2','200');
    I need bascially to get the total of the budget column. However this is not as simple as it sounds good (at least not for the me.) totals carried forward to the new period. you will notice that you have a period column. Basically, what im is that
    fgl_grant_year 10 1 period = account 7600 its $100 and $100 for the period 2, you see $ 100 more, it wants to not be added to this is the door on the balance. that is $100.
    So im trying to write a query that basically does the following.
    IM considering a period for the sake of this example let period 1 I get anything else. I find that the greates contributes dumpster year the amount for the period 14 (which corresponds to the total of the previous year) and add it to the amount of the current year. in this case period 1 grnt_year 11
    the expected result is therefore $700
    240055     240055     7240     4730     02     10     14     200
    240055     240055     7600     4730     02     10     14     100
    240055     240055     7600     4730     02     11     1     400
    do not forget that I am not given a just a period of the year.
    any help you guys can give would be immensely appreciated. I tried to get this to work for more than 3 days now.
    Finally broke down and put together this post

    Published by: mlov83 on Sep 14, 2011 20:48

    Hello

    Thanks for posting the CREATE TABLE and INSERT statemnts; It is very useful.

    I'm not sure that understand your needs.
    The correct output will be just one line:

    TOTAL_BUDGET
    ------------
             700
    

    or will it be 3 ranks that you posted? I guess you want just line after line.

    Do you mean that you are given a period (for example, 1).
    First you have to find the largest gfl_grnt_year which is related to this period (in this case, 11).
    Then you need to add fgl_budget lines that have to be
    (1) the specific period and the largest fgl_grnt_year, or
    (2) perriod = 14 and the previous fgl_grnt_year (in this case, 10).
    Is this fair?

    If so, here's a way to do it:

    WITH     got_greatest_year     AS
    (
         SELECT     fgl.*     -- or whatever columns are needed
         ,     MAX ( CASE
                     WHEN  fgl_period = :given_period
                     THEN  fgl_grnt_year
                    END
                  ) OVER ()     AS greatest_year
         FROM     fgl
    )
    SELECT     SUM (fgl_budget)     AS total_budget     -- or SELECT *
    FROM     got_greatest_year
    WHERE     (     fgl_grnt_year     = greatest_year
         AND     fgl_period     = :given_period
         )
    OR     (     fgl_grnt_year     = greatest_year - 1
         AND     fgl_period     = 14
         )
    ;
    

    If you want the 3 lines you have posted, then change the main SELECT clause to ' SELECT * ' (or, instead of *, youcan the columns you want to see the list).

  • Need help to access a different drive

    I connected a hard drive in XP on a computer that is running 7.  How to restart the computer to run under the XP disc?

    Hello

    That one disc at a time can be C: and it seems that Windows 7 and XP have been installed
    in this way, then you will need to pass the cables then XP will start as C: and, of course, Windows 7
    then wouldn't boot.

    ---------------------------

    How to set up a Dual Boot Installation with Windows 7 and XP
    http://www.SevenForums.com/tutorials/8057-dual-boot-installation-Windows-7-XP.html

    Definitive dual-booting guide: Windows 7, Linux, Vista and XP step-by-step
    http://apcmag.com/the_definitive_dualbooting_guide_linux_vista_and_xp_stepbystep.htm

    Dual Boot computer preinstalled Windows 7 with XP
    http://www.howtogeek.com/HOWTO/8790/dual-boot-your-pre-installed-Windows-7-computer-with-XP/

    ----------------------------

    How to create a multiple-boot system in Windows XP
    http://support.Microsoft.com/kb/306559

    EasyBCD - free - response of award-winning several NeoSmart Technologies to take control of
    your bootloader. EasyBCD extends and rearranges the Windows Vista/Windows 7 BCD bootloader,
    and with EasyBCD, almost anything is possible. Install and configure a dual-boot between
    Windows 7, Windows Vista, older versions of Windows like XP & 2003, Linux, Ubuntu, BSD,
    and Mac OS X is a breeze. You just point & click and EasyBCD does the rest. EasyBCD is free for the
    private, non-commercial use.
    http://NeoSmart.NET/DL.php?id=1

    Consult the EasyBCD Forums and support.
    http://NeoSmart.NET/forums/

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="" -="" mark="" twain="" said="" it="">

  • Need help custom calculation Script

    I need to make a script are a column of fields based on or no information found in another column of fields is the same or specific text. Please find below the screenshot of what I would like that to be done.

    I would like a sum of all the amounts that had Code A...

    You can use this script as of 'SumOfA ': custom calculation script

    var total = 0;
    for (var i=0; i<=2; i++) {
        if (this.getField("p1TC."+i).value=="Code A")
            total+=Number(this.getField("p1RecIn."+i).value);
    }
    event.value = total;
    

    You can adjust easily to the other field as well.

  • Need help for calculation script

    I was instructed to convert an Excel file into a fillable PDF, with formulas and calculations. Unfortunately, I'm a complete newbie to creating forms using calculations and javascript, but so far, I was able to use the built-in functions or to find examples of javascript for the formulas that I am duplicating. However, my final calculation stuck me.

    Basically, I do an if / then calculation based on a field being greater or less than another. If the result is greater, the script should return a 'YES', if it is lower, it should return a 'no' the excel function is as follows:

    = IF(C45>C32,"YES","NO")

    Could someone help me with this script?

    Here is the code for calculating customized to do this, assuming that the names of the other fields are C45 C32 and that their format is set to number:

    c45 var = getField("C45").value;

    c32 var = getField("C32").value;

    If (c45! = "" & c32! = "") {}

    If the two fields are not empty, compare them...

    Event.Value = c45 > c32? "YES": "NO";

    } else {}

    If the fields are empty, reset this field

    Event.Value = "";

    }

  • Need help with styles of different links on the same page

    Hello

    I use Dreamweaver CS4 on a PC.

    I searched through a large number of posts during the last two days, I tried the tutorial projectseven.com, google would, etc., but still may not know...

    All I want to do is apply a different link color to some links at the bottom of my page. Elsewhere on the site, I put the color blue (for the link) and orange (for the hover)-for footer links, I want the link to be white and the hover to stay orange color.

    The problem with the projectseven tutorial is that it seems not to apply to the CS4 and I kept getting error messages when you try to apply a new CSS rule - there is no class. Tag | Advanced according to the instructions...

    I copied the code to my page for this. The links I want to apply a different style to are contained in the DIV called "Footer-Navigation-Bar.

    Could someone please give me some instructions or point me in the right direction please?

    Thank you very much

    Vickie

    <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""
    <!-saved from url = (0014) subject: internet->
    "< html xmlns ="http://www.w3.org/1999/xhtml">".
    < head >
    < meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 "/ >"
    <!-TemplateBeginEditable name = "doctitle"-->
    the < title > Australia subscribe to the family - it's free! < /title >
    <! - TemplateEndEditable - >
    "" < link href = "... / family - subscribe.css" rel = "stylesheet" type = "text/css" / >
    "" < script src = "... / SpryAssets/SpryMenuBar.js" type = "text/javascript" > < / script >
    "" < link href = "... / SpryAssets/SpryMenuBarHorizontal.css" rel = "stylesheet" type = "text/css" / >
    <!-TemplateBeginEditable name = "head"->
    <! - TemplateEndEditable - >
    < style type = "text/css" >
    <!--
    a: link {}
    color: # 30;
    text-decoration: none;
    }
    a: hover {}
    color: #F30;
    text-decoration: none;
    }
    a: visited {}
    text-decoration: none;
    }
    a: active {}
    text-decoration: none;
    }
    ->
    < / style > < / head >

    < body >
    < div id = "container" >
    < div id = "banner" >
    < ul id = "family-subscribe-menu" class = "MenuBarHorizontal" >
    "< li > < a href ="... / index.html "> home < /a > < /li >"
    "< li > < a href ="... / subscribe.html "> Subscribe < /a > < /li >"
    "" < li > < a href = "... / family - advertise.html" > announced < /a > < /li >
    "" < li > < a href = "... / family - articles.html" > items < /a > < /li >
    "" < li > < a href = "... / family-sign - in .html" > questions < /a > < /li >
    "" < li > < a href = "... / family - contribute.html" > Contribute < /a > < /li >
    "" < li > < a href = "... / family - contact.html" > Contact < /a > < /li >
    < /ul >
    < / div >
    "" "" < div id = "sidebar" > < a href = "... / family-sign - in .html" > < img src = "... /images/Launch-issue.jpg" alt = "number of launch" width = "220" height = "380" hspace = "4" / > < / has >
    < div id = "sidebar-image2" >
    "" < p > < img src = "... / pictures/sleeping bag for Web.jpg" width = "220" height = "151" alt = "sleeping bag" / > < / p >
    < p > Kozy Koala™ Sleeper pillow is ideal for summer nights when children want to sleep or when go you camping. The camper all-in-one pillow is composed of... [MORE] < /p >
    < / div >
    < div id = "sidebar-image3" >
    "" < p > < img src = "... / pictures/solrx for Web.jpg" width = "220" height = "164" alt = "sunscreen" / > < / p >
    SolRX® solar filters are very sweaty and resistant to the water-ideal for anyone who leads a life active outdoor... whether you are in the water or not! [MORE] < / div >
    < / div >
    <!-TemplateBeginEditable name = "content-area"->
    < div id = "main content" > main content < / div >
    <! - TemplateEndEditable - >
    < div id = "footer" >
    "" < div id = "page-navigation-bar foot" > < a href = "... / family - about.html ' > on < /a > | "" < a href = "... / family - advertise.html" > announced < /a > | "" < a href = "... / family - contribute.html" > help < /a > | "" < a href = "... / family - contact.html" > contact < /a > | "" < a href = "... / family - unsubscribe.html" > unsubscribe < /a > < / div >
    < div id = "foot of page-text" > Family Australia | ABN 33150685385 | "For all advertising inquiries, please contact < a href ="mailto:[email protected] "> [email protected] < /a > < br / >"

    Copyright © 2010 family Australia. All rights reserved.
    < / div >
    < / div >
    < / div >
    < / div >
    < script type = "text/javascript" >
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar ("family-subscribe-menu", {imgDown: "SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});})
    ->
    < /script >
    < / body >
    < / html >

    The links I want to apply a different style to are contained in the DIV called "Footer-Navigation-Bar.
    ......
    ......
    a: link {}

    color: # 30;
    text-decoration: none;
    }
    a: hover {}
    color: #F30;
    text-decoration: none;
    }
    a: visited {}
    text-decoration: none;
    }
    a: active {}
    text-decoration: none;
    }

    Hello

    You can see the CSS that applies to your links above.  If you have links you want to style in a different way, just write the rule as follows:

    #Footer - Navigation - Bar has: link {}

    color: Red;

    text-decoration: none;

    }

    Or whatever.  There are other ways, but this will make you as you already have these links you want to style differently in a div with its own code.  The new rule comes after other rules in your CSS I think that to make sure of the cascade, well thinking about, there is something called specificity in the CSS, which means that the rule I suggest will win anyway.  Everything you do in my suggestion is to select one: a link that is a descendant of an element with particular ID.

    I hope this helps.  I am a novice and might have gotten a little fuzzy with the waterfall/specficity but good, I think you get where you want to go...

    Martin.

  • Need help for an itemrenderer component data

    I have a datagrid populated by a dataprovider (collection arrayCollection). No question here

    I have a Custom itemRenderer (as a component) dateField and therefore filled very well, no issue there either.

    However I can't seem to find a way to get the data out (it can be changed, so it is no longer the original data). I can get the original data, but not the new data.

    I can't use an event as there are hundreds of lines I need to handle to write to the database. I just want to get all such values as displayed in the datagrid control.

    I want to just loop through the datagrid and pull data, as written in the object to the itemrenderer component. In debug mode, I can see

    event->-> mycustomecomponent-> text-> [legacy] itemrenderer. I can't get to work.

    Any ideas. There has got to be simple, and just miss him I guess.

    In your ItemRenderer, assign the new value once completed editing your data.yourDataFieldHere. This will then allow you to loop through the dataProvider in the main application and get all the required values.

    function onEdit(evt:Event):void {}

    data.yourDataField = evt.currentTarget.text; Or use of any property of the modified element you need here.

    }

    Chris

  • Need help to extract the Exif data

    I can't wrap my brain on how to get an individual item in a generated table. Here's what I'm trying to do: I have a script that will read all the information of an image file's exif header. It traverses the list and display each element exif very well. If I keep stuck trying to extract specific items such as copyright, artist, and description. I took the script out of the php.net site and I understand well enough how it works completely.

    Can someone break it down by the measures taken by the script? I think that if I understood it better that I could figure out how to get what I need. For example, should I loop through the $exif table before I can point to the specific exif info I want? I also don't understand the exif_read_data() function parameters (I read what php.net, but it is clear to me).

    Thanks in advance for any help.
    Mike D

    I finally got. The code in the previous post works as what. I had the wrong variable in the "alt" tags It should have been $image_description. Problem solved.

  • Need help with images of different sizes being loaded from a container of centering

    Stop();

    mainArea_mc.visible = false;

    home_btn.addEventListener (MouseEvent.CLICK, function () {Stop ("model home")});

    var totalImages:int = 0;

    var imageDirectory: String = "";

    var currentImage:int = 1;

    var filePrefix: String = "";

    var loader1: Loader = new Loader(); 2 Chargers, so we can fade a picture on top of the other

    var loader2: Loader = new Loader();

    pic_mc. AddChild (loader1);

    pic_mc. AddChild (loader2);

    loader1. Name = "loader1."

    loader2. Name = "loader2";

    loader1.contentLoaderInfo.addEventListener (Event.COMPLETE, resizeFadeImage);

    loader2.contentLoaderInfo.addEventListener (Event.COMPLETE, resizeFadeImage);

    info_mc.title_txt. AutoSize = TextFieldAutoSize.LEFT;

    If (presModeSlides) / / slides Viewer vars configuration

    {

    totalImages = slides [currentSlideNumber] .numSlides

    imageDirectory = "Data/slides/"+slides[currentSlideNumber].directory+"/";

    filePrefix = "slide";

    info_mc.title_txt. Text = .title slides [currentSlideNumber]

    info_mc.speaker_txt. Text = .speaker slides [currentSlideNumber]

    info_mc.university_txt. Text = .university of slides [currentSlideNumber]

    }

    else / / Setup Photo viewer vars

    {

    totalImages = 233;

    imageDirectory = "data/images /";

    filePrefix = "image";

    info_mc.title_txt. Text = "user International BioPlex® 2200 3 meeting;

    info_mc.speaker_txt. Text = "Images";

    info_mc.university_txt. Text = "";

    }

    info_mc.speaker_txt.y += info_mc.title_txt.height;  Position sublines so that they are directly under the title

    info_mc.university_txt.y += info_mc.title_txt.height;

    leftArrow_btn.addEventListener (MouseEvent.CLICK, prevImage);

    rightArrow_btn.addEventListener (MouseEvent.CLICK, nextImage);

    showImage (currentImage)

    function showImage(num:int)

    {

    If (pic_mc.getChildIndex (loader1) > pic_mc.getChildIndex (loader2)) / / set the jpg file in what container is on top for the moment

    {

    loader1. Load (new URLRequest (imageDirectory + filePrefix + currentImage + '.jpg'));

    }

    on the other

    {

    loader2. Load (new URLRequest (imageDirectory + filePrefix + currentImage + '.jpg'));

    }

    }

    function resizeFadeImage(e:Event)

    {

    e.currentTarget.loader.alpha = 0;

    Tweener.addTween (e.currentTarget.loader, {alpha: 1, time: 0.4, onComplete: removeOtherImage, onCompleteParams:[e.currentTarget.loader]});})

    e.currentTarget.loader.scaleX = 0.75;

    e.currentTarget.loader.scaleY = 0.75;

    var bitMap: Bitmap = Bitmap (e.currentTarget.loader.content);

    bitMap.smoothing = true;

    }

    function removeOtherImage(l:Loader)

    {

    If (l.name is "loader1")

    {

    pic_mc. SetChildIndex(loader1,0);

    If (loader2.content! = null)

    {

    If (loader2.content is Bitmap)

    {

    (loader2.content as Bitmap).bitmapData.dispose ();

    }

    }

    }

    on the other

    {

    pic_mc. SetChildIndex(loader2,0);

    If (loader1.content! = null)

    {

    If (loader1.content is Bitmap)

    {

    (loader1.content as Bitmap).bitmapData.dispose ();

    }

    }

    }

    }

    function nextImage(e:Event)

    {

    If ((!)) Tweener.isTweening (loader1)) & & (!) Tweener.isTweening (loader2)))

    {

    If (currentImage < totalImages)

    {

    currentImage ++;

    }

    on the other

    {

    currentImage = 1;

    }

    showImage (currentImage);

    }

    }

    function prevImage(e:Event)

    {

    If ((!)) Tweener.isTweening (loader1)) & & (!) Tweener.isTweening (loader2)))

    {

    If (currentImage > 1)

    {

    -currentImage;

    }

    on the other

    {

    currentImage = totalImages;

    }

    showImage (currentImage);

    }

    }

    :

    function resizeFadeImage(e:Event)

    {

    e.currentTarget.loader.alpha = 0;

    Tweener.addTween (e.currentTarget.loader, {alpha: 1, time: 0.4, onComplete: removeOtherImage, onCompleteParams:[e.currentTarget.loader]});})

    e.currentTarget.loader.scaleX = 0.75;

    e.currentTarget.loader.scaleY = 0.75;

    e.currentTarget.loader.x = (stage.stageWidth-e.currentTarget.loader.width)/2;

    e.currentTarget.loader.y = (stage.stageHeight-e.currentTarget.loader.height)/2;

    var bitMap: Bitmap = Bitmap (e.currentTarget.loader.content);

    bitMap.smoothing = true;

    }

  • Need help with XML, view the data by scanning/click

    Hello.

    I am creating a moibile app that displays XML data. It is a telephone directory. I want the data to change when we slide. I can get the data very well. I can get it to display fine. I do not see the correct image first, however. I think it's a problem with my imagenum variable.

    Then, I want to change what is displayed when the user clicks/slide on the screen. How do I do that?

    Stop();
    var nameArray:Array = new Array();
    var countryArray:Array = new Array();
    var portraitArray:Array = new Array();
    var flagArray:Array = new Array();
    var jobtitleArray:Array = new Array();

    var imageNum:Number = 0;
    var totalImages:Number;

    Loading XML
    var XMLURLLoader:URLLoader = new URLLoader();
    XMLURLLoader.load (new URLRequest ("recbook.xml"));


    XMLURLLoader.addEventListener (Event.COMPLETE, processXML);


    function processXML(event:Event):void {}

    var theXMLData:XML = new XML (XMLURLLoader.data);
    totalImages = theXMLData.name.length ();
    for (var i: Number = 0; i < totalImages; i ++) {}
    Data in the tables xml push
    nameArray.push (theXMLData.name [i]);
    countryArray.push (theXMLData.country [i]);
    portraitArray.push (theXMLData.portrait [i]);
    flagArray.push (theXMLData.flag [i]);
    jobtitleArray.push (theXMLData.jobtitle [i]);
    }
    the data is processed

    loadData();
    }

    function loadData (): void {}

    var thisPortrait:String = portraitArray [imageNum];
    var thisCountry:String = countryArray [imageNum];
    var thisName:String = NomTableau [imageNum];
    var thisJobtitle:String = jobtitleArray [imageNum];
    var thisFlag:String = flagArray [imageNum];

    var dataLoader:Loader = new Loader();
    dataLoader.load (new URLRequest (portraitArray [imageNum]));
    dataLoader.contentLoaderInfo.addEventListener (Event.COMPLETE, dataLoaded);
    function dataLoaded(event:Event):void {}

    I want to start with 0 (img1.jpg) image and scroll with a click of the mouse (finger on iOS kick)
    stage.addEventListener (MouseEvent.CLICK, loadMainImage1);
    function loadMainImage1(event:MouseEvent):void {}
    portraitUILoader.source = thisPortrait;
    flagUILoader.source = thisFlag;
    selectedName.text = thisName;
    selectedCountry.text = thisCountry;
    selectedJobtitle.text = thisJobtitle;
    }
    }

    Add to imageNum (1);
    imageNum ++;
    If (imageNum < totalImages) {//stopping to img2
    trace ("imageNum" + imageNum);
    trace ("name of the image (tomyline)" + tomyline "); losing picture 4 somewhere

    loadData();
    }

    trace ("Total Images" + totalImages);

    }

    Click here to pass the screenI House would this gap. do not know how.
    homeScreen_mc.addEventListener (MouseEvent.CLICK, goNext);

    function goNext(event:MouseEvent):void
    {
    nextFrame();
    }


    * / Here is the result:
    imageNum 1
    image name (tomyline) images/img1.jpg
    imageNum 2
    image name (tomyline) images/img2.jpg
    imageNum 3
    image name (tomyline) images/img3.jpg
    Total of 4 Images
    Total of 4 Images
    Total of 4 Images
    Total of 4 Images

    It starts on frame 1 display (the second in the series img2.jpg) * /.

    If (imageNum< totalimages)="" {//stopping="" at="">
    trace ("imageNum" + imageNum);
    trace ("name of the image (tomyline)" + tomyline "); losing picture 4 somewhere
    imageNum ++;
    If (imageNum! = totalImages) loadData();
    }

  • need help for a conditional query

    guys this is just. as an extension of this post that Frank was helping me. IM reposting because my needs change slightly and im having a hell of a time trying to change the query.
    Here are the previous post.
    need help with query can find data back please help.
    CREATE TABLE "FGL"
      (
        "FGL_GRNT_CODE" VARCHAR2(60),
        "FGL_FUND_CODE" VARCHAR2(60),
        "FGL_ACCT_CODE" VARCHAR2(60),
        "FGL_ORGN_CODE" VARCHAR2(60),
        "FGL_PROG_CODE" VARCHAR2(60),
        "FGL_GRNT_YEAR" VARCHAR2(60),
        "FGL_PERIOD"    VARCHAR2(60),
        "FGL_BUDGET"    VARCHAR2(60)
      )
    data
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','11','00','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','1','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','1','0');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','11','1','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('360055','360055','7200','4730','02','10','1','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('360055','360055','7600','4730','02','10','1','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','14','200');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','10','14','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','14','200');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','2','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','11','2','600');
     
     
    I need to find the year of greater subsidy for the granting by a period setting.
    Once I found the great year, I need to check the value of the period 14 this grant for the previous year and add it to the amount of the budget for this grant. However if there is an entry in the biggest year for period 00 so I need to ignore the period 14 of the previous year and the current calculation period + (current period - more great year 00)

    hope that makes sense, so in other words, with the new data above. If I asking me a second period of the grant year 11. I'd end up with $800

    because the greatest year is 11 it contains one point 0 with $ 400, so my total should be
    amount of period $2,600
    period $0 400 - period $2 600 = $200

    600 + 200 = $800

    If I have question period 1 grant 360055 I'd end up just with 800 grnt year 10.

    I tried to edit this query you have provided me with no luck. I tried for several embarrassed day but I'm saying I can just do what im trying to do.
    can you please help me.


    Here's the query provided by frank kulash who graciously put it together for me.
    WITH     got_greatest_year     AS
    (
         SELECT     fgl.*     -- or whatever columns are needed
         ,     MAX ( CASE 
                     WHEN  fgl_period = :given_period 
                     THEN  fgl_grnt_year
                    END
                  ) OVER ()     AS greatest_year
         FROM     fgl
    )
    SELECT     SUM (fgl_budget)     AS total_budget     -- or SELECT *
    FROM     got_greatest_year
    WHERE     (     fgl_grnt_year     = greatest_year
         AND     fgl_period     = :given_period
         )
    OR     (     fgl_grnt_year     = greatest_year - 1
         AND     fgl_period     = 14
         )
    ;
    Miguel

    Hi, Miguel.

    You are waying that when larger year who has: given_period also a period = '00' (or '0', or whatever it is you want to use), then you want to double the budget of the given_period (subtract the '00' budget and do not count '14' year pevious)? If so, add another condition to the CASE statement that decides what you've summarized:

    WITH     got_greatest_year     AS
    (
         SELECT       TO_NUMBER (fgl_grnt_year)     AS grnt_year
         ,       fgl_period
         ,       TO_NUMBER (fgl_budget)     AS budget
         ,       MAX ( CASE
                       WHEN  fgl_period = :given_period
                       THEN  TO_NUMBER (fgl_grnt_year)
                      END
                    ) OVER ()     AS greatest_year
         FROM       fgl
    )
    ,     got_cnt_00     AS
    (
         SELECT     grnt_year
         ,     fgl_period
         ,     budget
         ,     greatest_year
         ,     COUNT ( CASE
                       WHEN  grnt_year     = greatest_year
                       AND       fgl_period     = '00'
                       THEN  1
                         END
                    ) OVER ()          AS cnt_00
         FROM    got_greatest_year
    )
    SELECT       SUM ( CASE
                        WHEN  grnt_year     = greatest_year                    -- New
                  AND       fgl_period     = :given_period                    -- New
                  AND       cnt_00     > 0            THEN  budget * 2     -- New
                        WHEN  grnt_year     = greatest_year
                  AND       fgl_period     = :given_period       THEN  budget
                        WHEN  grnt_year     = greatest_year
                  AND       fgl_period     = '00'            THEN -budget
                        WHEN  grnt_year     = greatest_year - 1
                  AND       fgl_period     = '14'
                  AND       cnt_00     = 0            THEN  budget
                    END
               )          AS total_budget
    FROM       got_cnt_00
    ;
    

    You will notice it is the same as the previous query, I posted, with the exception of 3 lines marked 'new '.

Maybe you are looking for