Identification of date Even or odd

Hi All,
could you please tell me how can i identify the given date is even or odd.
please provide me if there is any function module  or logic.
Thanks in Advance.
Sudhakar

hii
i dont think there is any FM for this
you can use following logic to find odd even numbers.take date in one variable and use
data:
      w_rem type p decimals 2,
      w_val type i.
w_rem = ( w_val mod 2 ).
if w_rem = 0.
  write:/ 'Even'.
else.
  write:/ 'Odd'.
endif.
regards
twinkal

Similar Messages

  • Determine if a number is even or odd in php

    hi,
    working on a site that uses php and mysql. on one page, i
    pull data from a database and put it into a table. the data is
    about scientific papers so i have the following fields: id (unique
    to each row), title, author, type, content (contains url to the pdf
    file), and size. when i run it, the background of the whole table
    is white. i want it so that each row of the table alternates
    between having a light grey and a white background. i was thinking
    about looking into my loop to see if the variable $i is even or
    odd. using an if statement if $i is even, background is grey, if $i
    is odd, the background is white. how do i do this, and am i on the
    right track or is there an easier way to do this? below is the
    code. im new to php and mysql. Thanks!!

    use de modulus operator:
    ($i % 2) = 0 --> even
    ($i % 2) = 1 --> odd
    jmack159 wrote:
    > hi,
    >
    > working on a site that uses php and mysql. on one page,
    i pull data from a
    > database and put it into a table. the data is about
    scientific papers so i have
    > the following fields: id (unique to each row), title,
    author, type, content
    > (contains url to the pdf file), and size. when i run it,
    the background of the
    > whole table is white. i want it so that each row of the
    table alternates
    > between having a light grey and a white background. i
    was thinking about
    > looking into my loop to see if the variable $i is even
    or odd. using an if
    > statement if $i is even, background is grey, if $i is
    odd, the background is
    > white. how do i do this, and am i on the right track or
    is there an easier way
    > to do this? below is the code. im new to php and mysql.
    Thanks!!
    >
    > <table border="0" cellspacing="2" cellpadding="2">
    > <tr>
    > <th></th>
    > <th>Title</th>
    > <th>Author</th>
    > <th>Size</th>
    > </tr>
    > <?
    > $username="username";
    > $password="password";
    > $database="database";
    >
    > mysql_connect(localhost,$username,$password);
    > @mysql_select_db($database) or die( "Unable to select
    database");
    >
    > $query="SELECT * FROM paper";
    > $result=mysql_query($query);
    > $num=mysql_numrows($result);
    >
    > $i=0;
    > while ($i < $num) {
    > $title=mysql_result($result,$i,"title");
    > $author=mysql_result($result, $i, "author");
    > $content=mysql_result($result, $i, "content");
    > $type=mysql_result($result, $i, "type");
    > $size=mysql_result($result, $i, "size");
    > ?>
    >
    > <tr>
    > <td><a href="<? echo "$content";
    ?>"><img src="images/icon_pdf.gif"
    > alt="download pdf" /></a></td>
    > <td><a href="<? echo "$content";
    ?>"><? echo "$title"; ?></a></td>
    > <td><a href="<? echo "$content";
    ?>"><? echo "$author"; ?></a></td>
    > <td><? echo "$size"; ?></td>
    > </tr>
    >
    > <?
    > $i++;
    > }
    >
    > mysql_close();
    > ?>
    >
    > </table>
    >

  • How to test if a decimal is even or odd in labview

    i made a VI that tests for even and odd integers using the quotient/remainder function and the Select function but when i test a decimal it does not work properly.
    i have my VI testing to see if the input diveded by 2 gives you a remainder equal to 0, and if it does then it is even and the VI displays a messege saying "Even", but when i put in a decimal ( for example 7.2) the remainder is spitting out 1.2 which is not equal to 0 making my VI not work properly, if anybody can help me with this i would greatly appreciate it and if you could attached a photo that would help me understand what my mistake is, Thanks i have attached my VI for you to look at
    Attachments:
    P 3.7.vi ‏34 KB

    As has been already said, odd/even is only defined for integers, so you need to tell us what you expect for e.g. 7.2.
    Do you want to know if the last decimal digit is even or odd?
    Do you want to know if the nearest integer is even or odd?
    While you are at it, you might also think a bit more about your program design:
    What is the purpose of your "select" primitive? What do you think would be different if you just leave it out completely?
    Why do you test for "equal zero" and "not equal zero"? One is just the inversion of the other and knowing one also determines the other automatically.
    Why do you use two dialog boxes? Do one comparison and use "select" to switch between the two messages. Only one express dialog needed.
    Don't mix blue and orange. Select the correct representation for your diagram constants.
    There is a primitive for "equal zero"
    Never use equal and not equal comparison with orange numeric data (DBL). You might not get expected results.
    LabVIEW Champion . Do more with less code and in less time .

  • How to display even and odd number ranges between two given inputs.

    Hi Every one,
    I am just started my career in sap abap and trying to find the solution for this.
    I am trying to display number range using select options, but I am getting an error "Memory low leave the transaction before taking a break".
    Example: when I give two number 2 and 10 , it should display set of all even and odd numbers in that range.
    Below is the code logic that I am using:
    data: a type i,
             b type i,
             c type i,
             d type i,
             num type i.
    select-options: in for num.
    a = inp-low.
    b=inp-high.
    c = inp-low mod 2.
    d = inp-high mod 2.
    while a <=b and c = 0.
    write: "even numbers:', a.
    b = a + 1.
    endwhile.
    while a <=b and c <> 0.
    write: "odd numbers:', b.
    b = a + 1.
    endwhile.
    Any help will be much appreciated.

    This is your logic...changed:
    data: a type i,
              b type i,
              c type i,
              d type i,
              num type i.
    data: even type i,
           odd  type i.
    select-options: in for num.
    a = in-low.
    b = in-high.
    c = a mod 2.
    if c is INITIAL. "It measn a is even
       even = a.
       odd  = a + 1.
    else.
       odd  = a.
       even = a + 1.
    endif.
    * Even
    a = even.
    while a <= b.
       write: / 'even numbers:', a.
    *  b = a + 1.
       a = a + 2. "The next even number
    endwhile.
    * Odd
    a = odd.
    while a <= b .
       write: / 'odd numbers:', a.
       a = a + 2. "The next odd number
    endwhile.

  • IPhoto imports photos with wrong dates even if the dates are fine on the camera

    Hi!
    When I import photos with iPhoto, sometimes it imports them with wrong dates, even the dates are fine on the camera. It puts dates such as 2032. Does anyone know how can I fix that. As far as I know there is no way to change dates of the photos.
    Thanks!

    well that is very confusing since if the date is correct on the camera it will be correct in iPhoto
    and as to
    As far as I know there is no way to change dates of the photos.
    Try looking through your iPhto menus - two commands - adjust time and date and batch change time and date - asjust is used to correct incorrect dates like a comera setting -   Batch change for missing dates like with scans
    LN

  • I uninstalled Flash Builder 4.7 using the uninstall app.  I'd like to re-install the app, but Creative Cloud says it's up-to-date, even though it does not exist anymore on my computer.  How can I re-dowload it?

    I uninstalled Flash Builder 4.7 using the uninstall app.  I'd like to re-install the app, but Creative Cloud says it's up-to-date, even though it does not exist anymore on my computer.  How can I re-dowload it?

    CC desktop lists applications as "Up to Date" when not installed
    http://helpx.adobe.com/creative-cloud/kb/aam-lists-removed-apps-date.html

  • IPhone using cellular network to transmit/receive data even while on Wi-Fi

    I have recently noticed a strange problem with my 15 month-old 3GS. Although my phone sits at home most of time time and is constantly connected to my wi-fi network, it is still using the AT&T network to send and receive some data. I can see this by tracking my cellular data usage via the usage page in preferences and via the AT&T app.
    If I had an unlimited data plan, this wouldn't be an issue, but a couple of months ago I switched to the 200MB/month plan. If the phone is using the cellular network when it shouldn't be and using up megabytes that should be free under wi-fi, we've got a problem. Last month, I came within 5MB of my limit, in part, I believe, because my phone was not using wi-fi exclusively when connected to a working network (as it was a majority of the time).
    This evening, I reset all my usage statistics, and in less than four hours the phone has used 319KB of cellular data, even though it's been on wi-fi the entire time. In the time it took to type this message, it used 22KB of bandwith, not a lot in isolation, but it adds up over the month.
    Apple Care said to call AT&T, though I can't see why as it's either a software or hardware problem. They also said that MMS photo messages might account for the discrepancy, but I never send such messages and I've never received one either. AT&T isn't sure what to do, apart from giving me a credit if I do go over my limit.
    So, has anyone else noticed this happening? And can anyone offer an explanation or a solution (apart from turning off my cellular data and/or data roaming, which should not be necessary and compromises functionality)?

    If that's the problem, then I'll have to turn off the phone completely when I'm not actively using it, which sort of defeats the purpose of having a phone.
    If your iPhone is running iOS4.0 or later, you can turn Cellular Data off at Settings > General > Network > Cellular Data which prevents any data access via the cellular network without having to power your iPhone off.
    Do you have an email account or accounts set to be automatically checked for new messages?

  • Change colour of a circle whether mousePressed is an even or odd number

    Right this is sort've difficult to explain. I have implemented a grid of circles for a Connect 4 game with the help of you fine people :) Now to add to this, I am looking to change the colour of a circle depending on whether it's an even or odd mousePressed. Basically this is like playing somebody else, so each player takes it in turns. If there is an easier way to do this then I would greatly appreciate it.
    public class CircleGrid extends JPanel implements MouseListener
            boolean ifRed;
            public CircleGrid()
              ifRed = true;
              addMouseListener(this);
            public void toggleColor()
              ifRed = !ifRed;
              repaint();
            public void paintComponent(Graphics g)
              if (ifRed)
                g.setColor(Color.RED);
              else
                g.setColor(Color.BLUE);
              g.fillOval(0, 0, 50, 50);
            public void mousePressed(MouseEvent evt)
               toggleColor();
            public void mouseClicked(MouseEvent evt)
            public void mouseReleased(MouseEvent evt)
            public void mouseEntered(MouseEvent evt)
            public void mouseExited(MouseEvent evt)
         }That is the code which draws the ovals and such on to my gameCenter JPanel.
    I was thinking something like:
    pesudo code --
    if mousePressed is an even number
    then set g.setColor = blue
    else
    g.setColor = red
    Thank you guys. I would appreciate any help. I'm still very much a newbie and some of my questions, I'm sure, are trivial to most of you but we all have to start somewhere.

    Hey LW, cheers buddy. :)
    I used your idea.
    Here's my working code:
    if (clicks == 0)
                        ifRed = true;
                        repaint();
                        clicks = 1;
                   else if (clicks > 0)
                        ifRed = false;
                        repaint();
                        clicks = 0;
                   }

  • An Even or Odd Problem...

    Hey all,
    I'm trying to write a program that has a variable with a randomly generated number between 1 and 100, and if the number is even I would output EVEN to the screen, if it was Odd I would output ODD, like so:
    81 Odd
    39 Odd
    60 Even
    88 Even
    27 Odd
    then it would count them up in the end and out put that:
    Number of evens: 11
    Number of odds: 9
    I've been working on it for 4 days now and am having a heck of a time with it. Here's the code I've come up with so far:
    public class EvenOdd {
    public static void main(String[] args) {
    final double LIMIT = 100;
         double num = ((Math.random() * 100) + 1) * 5;
         if (num % 2 == 0)
         System.out.println(Math.round((2*(num-0.5))) + " Odd.");
         else
    System.out.println(Math.round((2*(num-0.5))) + " Even.");
    But it only outputs one number to the screen and it's FAR too large. I also don't know how I would add the numbers up to come up with an totaling output at the end. Does anyone have any idea as to how to help with this? All help is appreciated...

    public class EvenOdd {
         public static void main(String[] args) {
              final double LIMIT = 100;
              int evenNum = 0;
              int oddNum = 0;
              for (int i =0; i<LIMIT; i++) {
                double num = (Math.random() * 100);
                int roundedNum = (int) Math.round( num);
                if (roundedNum % 2 == 0) {
                   System.out.println(roundedNum + " Even");
                   evenNum++;
                else {
                   System.out.println(roundedNum + " Odd");
                   oddNum++;
              System.out.println("Number of evens: "+ evenNum);
              System.out.println("Number of odds: "+ oddNum);
    }AA

  • How do I select, extract, delete, etc... only the even or odd pages?

    I have a 2000+ page document and I need to somehow select all the even or odd pages so I can pull them out of it that doesnt require me from having to click 1000 individual thumbnails.  I know how to print even or odd pages but dont see any way of just selecting them for editing

    I don't know where they are in Word but the print dialog is standard throughout OSX and this seems logical enough.
    The only problem is the Paper Handling is hidden under Layout. But sort of makes sense.
    Peter

  • Is there a way to apply a master page to even (or odd) pages in a long document?

    I'm taking a very simple, large pdf document and bringing it into InDesign to add some graphics. The pdf is actually a customized 2-page document for a large employee group (i.e. pages 1 and 2 are for employee001, pages 3 and 4 are for employee002, pages 5 and 6 are for employee003, etc.).
    I've found a script that allows me to bring in all the pages of the pdf at one time, provided I've set up the correct number of blank pages in InDesign. What I'm looking for now is a way to apply a master page to all even numbered pages at one time. Or all odd pages. Anyone have any ideas?
    Ideally, an option that would import the entire pdf document, add the appropriate number of pages to the InDesign document, and be able to assign different master pages to even and odd pages would rock! Help!

    for (var i=0;i<= PageLength-1;i++)
    var isEven = function(someNumber){
    return (someNumber%2 == 0) ? true : false;
    if(isEven(newDoc.pages.item(i).name) == true)
              //Apply Master B for right page
              newDoc.pages.item(i).appliedMaster = app.activeDocument.masterSpreads.item("B-Master");
    //Move elements by x, y position, script label ContactEmail
    newDoc.pages.item(i).pageItems.item("ContactEmail").move([0.7292, 6.011]);
    }else{
              //Apply Master A for left page
              newDoc.pages.item(i).appliedMaster = app.activeDocument.masterSpreads.item("A-Master");
    }//for Else
    }//For

  • How to delete parent table data even though it has child records

    hi all,
    How to delete parent table data even though it has child records.
    ex: delete from pa_request cascade constraints;
    But this command is not working .
    Regards,
    P Prakash

    833560 wrote:
    ex: delete from pa_request cascade constraints;cascade constraints is DROP table option. It can't be used with DELETE. You need to delete child rows first or drop foreign keys and recreate them with ON DELETE CASCADE. Then:
    delete from pa_request will automatically delete child rows. However, personally I don't like ON DELETE CASCADE. You can, by mistake, delete half of your database without even realizing it.
    SY.

  • ITunes Match Gobbling Up Cellular Data (even though disabled)

    I've found a few previous threads that reference this problem, but it's pretty horrific especially now LTE is in the picture.
    Despite setting the "Use Cellular Data" option to OFF (verified in both Music and iTunes settings), if you select music to be downloaded (i.e. click the cloud icon), iTunes grabs the music regardless of whether you are on WiFi or Cellular.
    Scenario 1: I get a new iPhone5 and want to sync my existing music library to it. I have a playlist with all 2500 songs in it, so I go there and hit the cloud icon so all my music copies over. There's no way to pause the whole process - only individual songs - and no way to stop it using cellular data, so when I leave the house, my phone starts eating up my cellular data plan (2.5GB in 3 days, when most of my time was spent at home). I detailed this on my blog - http://lamejournal.com/2012/09/24/itunes-match-uses-cellular-data-even-when-you- say-no/
    Still, it shouldn't be so bad, because I spent most of my time at home. Right?
    Scenario 2: Your brand new iPhone 5 has problems staying connected to WiFi (see the many threads on this issue). What happens when it has problems with WiFi and drops off the network? Yup, you got it, it uses LTE instead. So while I'm sitting in my house, 10 feet away from a 802.11n access point, supposedly 'safely' downloading my music over my home Internet connection, my phone randomly decides it doesn't want to play with WiFi after all, and continues downloading on cellular instead. Isn't that great?
    This is ridiculous. The option "Use Cellular Data" should do exactly what it says - when turned OFF, iTunes should not be downloading iTunes Match data from the cloud over cellular. I have 20Gig of music to download, and thank goodness I caught it when I did before being hit with enormous overages.
    Hopefully this is just a bug and can be fixed easily and quickly by Apple.
    Thank you!

    I too queued up a handful of albums to download this morning, took a shower, walked the dog... and by the time I got to work, a text from VZW tells me I've used 50% of my (2GB) data for the month (2 days into billing cycle).  This is on a 4S with iOS6, with FiOS and Airport Express at home, so it should have finished the 750mb or so in the alloted 45 minutes, but the screen went dark, so iPhone took a nap instead of doing her job.
    This is bonkers for several reasons:
    1. If you queue several iCloud downloads, from within the Music app, there is no visible queue for the pending downloads. You have to go back into the artist/album to see the progress on each song OR enter the iTunes app to check the pending downloads.  WHAT? my queue is in ANOTHER app?*
    2. Queued downloads continue when the app is "killed" from the task switcher.  I guess this is a feature, but there is NO indication of a data connection in use.
    3. If the iPhone screen goes dark to sleep, it turns off wifi to save battery and any queued downloads stop.  They will resume, over any available data connection, regardless of user selected settings. This is true for partially downloaded songs and queued songs. If I wanted to use cellular to download, I would enable that setting.
    4. Podcasts, while a different app from music, uses the same data storage and download queueing.  So if you have pending downloads that you can't see the progress of, you may wonder why podcasts aren't updating.
    5. In music.app, if you have "show all music" set to on, there is no indication if an artist/album is available locally or in iCloud.  You have to browse into the tree to see the track names greyed out.  Or else you can toggle "show all music" in settings.  Why can't there be a toggle within music.app, or an iCloud/local tab?  While I'm ranting about Music app, PLEASE can we have a sort by Artist/Album/YEAR option like in iTunes on mac? 

  • Anyone know how to select only even or odd numbered files in lightroom?

    Anyone know how to select only even or odd numbered files in lightroom? I need to reduce the quantity of images in my timelapse sequence and this would help me greatly since there are 8250 images and doing this maually would be tediuos and make me want to kill myself.... : )

    Do this.
    If they are jpegs, use .jpg instead of CR2
    Be sure to save this as a preset, as you WILL need it again. Mine is named "select even CR2", that is why it says that in the upper right.

  • How to work even and odd number query

    Plz explain how below worked even and odd query
    2 ) why used subquery after from and which time we can use(what time of out put)
    even
    select * FROM (SELECT ROW_NUMBER() OVER(ORDER BY stud_id) as row ,grno,stud_id from stud_Enrollment) d
     WHERE d.row %2=0   
    odd
    select * FROM (SELECT ROW_NUMBER() OVER(ORDER BY stud_id) as row ,grno,stud_id from stud_Enrollment) d
     WHERE d.row %2=1

    Row_Number function returns the sequential number of a row
    (By using partition of a result set, starting at 1 for the first row in each partition)
    >> why used subquery after from and which time we can use(what time of out put)
    When we need sequntial numbers, we can use row_number function. Put it into derived table and use this derived table after FROM clause (Same way it is used in your query)
    CREATE TABLE stud_Enrollment (
    grno int,
    stud_id int,
    stud_name varchar(20)
    INSERT INTO stud_Enrollment
    VALUES (101, 511, 'Dheeraj'), (112, 521, 'Vaibhav'), (132, 522, 'Lalit'), (124, 564, 'Amogh'), (143, 598, 'Sushrut')
    SELECT * FROM stud_Enrollment
    -- Result of your table
    --grno stud_id stud_name
    --101 511 Dheeraj
    --112 521 Vaibhav
    --132 522 Lalit
    --124 564 Amogh
    --143 598 Sushrut
    -- Now we need to find out the rows which are at even position, ie row should be at position of 0,2,4,6,8 etc..
    -- But we don't have sequential number here in your table result
    -- So we can create one new column by using row_number function
    SELECT
    ROW_NUMBER() OVER (ORDER BY stud_id) AS row, --> additiona "row" column
    grno,
    stud_id,
    stud_name
    FROM stud_Enrollment
    -- We got "row" column in below output
    --row grno stud_id stud_name
    --1 101 511 Dheeraj
    --2 112 521 Vaibhav
    --3 132 522 Lalit
    --4 124 564 Amogh
    --5 143 598 Sushrut
    -- Now above table is used after FROM clause. It uses row column in WHERE part
    SELECT
    FROM (SELECT
    ROW_NUMBER() OVER (ORDER BY stud_id) AS row,
    grno,
    stud_id,
    stud_name
    FROM stud_Enrollment) d
    WHERE d.row % 2 = 0
    --row grno stud_id stud_name
    --2 112 521 Vaibhav
    --4 124 564 Amogh
    -Vaibhav Chaudhari

Maybe you are looking for

  • Reg: A/R Invoice and Credit Memo

    Hi Experts, While I'm trying to copy an A/R Invoice to credit memo, which status is open-printed, the 'Copy To' field of A/R Invoice is unavailable. Also it was possible for me to create A/R credit memo for that same A/R Invoice, using 'Copy From' op

  • Problems with logitech headset

    Hey guys I was just playing Call of Duty 4 the other day, using my Logitech headset on Mountain Lion 10.8.3. But when I updated to 10.8.4 the sound from the game just completely stuffed up. The music is OK but all other sound is gone. The only other

  • Formatted Search to do calculation

    Hi all, I have written an SQL query for my formatted search that reads select $|$170.12.0| This is to return the Total Amount Due in incoming payment form. But when I applied this to one of the UDF I created, it returns an error "Internal error (3006

  • Printer wont print word documents

    I have had my printer/scanner for nearly a year now, it seems to print anything except a word document. I have both word 13 and notebook on my system. It wont print from either program, I am wondering whether this printer comes with these programs in

  • HTAccess tag not working

    Hi there, I am using Sun One 6.1. I tried to write htaccess file that "protect" files ext with the <FILES> tag, but all I get is full reject to all file on the folder (the tag igonred i think). I read the man' and its look like the server support ver