Selecti according to today's dates

today's date is 02-APR-09 the query I use to get that is ....
select sysdate from dual;I want to search a table if the column contains today's date.
For example ...
select tablename from audit_logs where auditdate like '02-APR-09%';So how would I combine the two queries into a select/sub-select query ?
I tried ...
select tablename from audit_logs where auditdate like '(select sysdate from dual)||%';Which did not work .

Hi,
SYSDATE is a function. You can use it in any query, based on any table. In PL/SQL, you can use it without any query on any table.
Remember that all DATEs include hours, minutes, and seconds. They may not be displayed, but they are there.
So one way to use this in a query is:
select  tablename
from    audit_logs
where   TRUNC (auditdate) = TRUNC (SYSDATE);A slightly more complicated way (but potentialy more efficient) is
select  tablename
from    audit_logs
where   auditdate >= TRUNC (SYSDATE)
and     auditdate <  TRUNC (SYSDATE) + 1;This way, an index on auditdate can be used.

Similar Messages

  • Select statement for today's date

    Hi,
    I need to write  a select query which fetches all  the entries of a table for today's date , how do i do it pls..

    Hi,
    SELECT <field-names to retrieve>
       FROM <database table name>
        INTO  TABLE <internal table name>
    WHERE <date field name> eq sy-datum.
    or
    SELECT * FROM <database table name>
        INTO  TABLE <internal table name>
    WHERE <date field name> eq sy-datum.
    this statement will fetch all the data's from your database table with respect to your date field. use parameter or select option to get the field value...then finally use
    loop at <itab>
    write: / <itab-field>.
    endloop.

  • Af:chooseDate always shows wrong selection (today's date)

    Hi,
    I'm using 10.1.3.3. I think that the af:chooseDate component has a serious usability problem: it's always showing today's date as currently selected, although the related af:selectInputDate component is refreshed correctly. This is true even:
    - after any number of clicks (selections),
    - after changing the month back and forth,
    - when using different types (Date, Calendar, String) of bound variables (e.g. in a session bean),
    - when the bound variable has a default value,
    - when triggering additional PPR refresh event for the component (just to be sure that it's refreshed).
    Does anybody have any ideas how to make it work correctly? This behaviour is very confusing for the users and I really need to use this component instead of a popup window offered by af:selectInputDate.
    Thanks in advance,
    Patrik

    Frank, I think that's just another description of the problem. Though it does not have a state, it knows about the input field - so the selection should be refreshed via PPR or JavaScript. In case anybody is interested, here is the JS i wrote to solve this.
    // Mark clicked day as selected in an af:chooseDate component
    function markClickedDayAsSelected(e) {
        var eventSourceElement;
        if(e==null) {
            eventSourceElement = event.srcElement; //IE
        else {
            eventSourceElement = e.target; //FF
        if (eventSourceElement.className != "x4r" && eventSourceElement.nodeName == "A") {
            var days = document.getElementById("formId:chooseDateId").getElementsByTagName("tbody")[0].getElementsByTagName("tr")[1].
    getElementsByTagName("td")[0].getElementsByTagName("table")[0].getElementsByTagName("tbody")[0].getElementsByTagName("span");
            for (var i=0; i<days.length; i++) {
                var d = days;
    if (d.className=="x4r") {
    // Move innerHTML outside of SPAN.x4r (into A) and remove SPAN.x4r
    var newInner = d.innerHTML;
    var appendToNode = d.parentNode;
    appendToNode.innerHTML=newInner;
    break;
    // Move innerHTML into a new SPAN.x4r inside A
    var newSpan = document.createElement("span");
    newSpan.className="x4r";
    var inner = eventSourceElement.innerHTML;
    newSpan.innerHTML=inner;
    eventSourceElement.innerHTML="";
    eventSourceElement.appendChild(newSpan);
    Regards,
    Patrik

  • How to display today's date in a textfield?

    Hi all,
    I have a textfield and it is a page item P18_DOJ.By defalut I want to display today's date in that textfield and it is should be readonly.How do i do that?

    Put "Select sysdate from dual;" as source type SQL Query and "readonly" in the HTML Form Element Attributes field.

  • I want today's date as delivery date.................

    hi,
    sap gurus,
    good morning to all,
    Before transportation module configuration
    for Eg; if today is the day of sales order creation my schedules lines in that order use to show today's
    date is the date of delivery automatically.
    after transportation module configuration the same schedule lines is showing 13 days after only you
    can deliver the goods.
    where i did wrong in configuration settings
    please let me know
    regards

    Dear Balaji
    I think u r working on IDES, hope u know that when the schedule line is determined, the system carries out Backward Scheduling and or forward Scheduling, accordingly the delivery date is confirmed.
    Now various factors to be considered in Scheduling are - Transportation Planning Time, Material Staging Time, Pick/Pack Time, Loading Time,
    These time duartions are maintained in  IMG  -  LE - Shipping - Basic Shipping functions - Scheduling - Define Scheduling by shipping pt. - Maintain duration
    U can also activate / Deactivate scheduling for the Sales Doc here only in ' Scheduling by Sales Doc Type'
    Again how the Loading Time and Pick/Pack time is to be determined is defined here in 'Scheduling by Shipping Point'
    Hope this helps u.

  • Get today's date?

    I have an XML dataset that shows a schedule of events.  My page uses a yui calendar widget to get the events for specific selected days.  On load, the page shows all "events" that are listed in the XML file.  I am trying to set up a filter that will only show the events for today and days after today, on loading.  How do you set a variable to have the value of today's date, without explicitly typing in "10/30/2009?"  I don't want to call the filterData() function, because I still want to see what was scheduled in the past by selecting the dates in the calendar.  Any ideas would be greatly appreciated.
    Here is my code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <script src="SpryAssets/xpath.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryData.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryDataExtensions.js" type="text/javascript"></script>
    <script src="yui/2.6.0/build/yahoo-dom-event/yahoo-dom-event.js" type="text/javascript"></script>
    <script src="yui/2.6.0/build/calendar/calendar-min.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryDOMUtils.js" language="javascript" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    var dsEvents = new Spry.Data.XMLDataSet("schedule.xml", "events/event", {sortOnLoad: "date", sortOrderOnLoad: "ascending"}  );
    dsEvents.setColumnType("date", "date");
    dsEvents.setColumnType("@id", "number");//-->
    </script>
    <link href="yui/2.6.0/build/fonts/fonts-min.css" rel="stylesheet" type="text/css" />
    <link href="yui/2.6.0/build/calendar/assets/skins/sam/calendar.css" rel="stylesheet" type="text/css" /></head><body>
    <div id="Schedule">
      <div id="yuicalendar1"></div>
      <script type="text/javascript">
    // BeginWebWidget YUI_Calendar: yuicalendar1   (function() {
        var cn = document.body.className.toString();
        if (cn.indexOf('yui-skin-sam') == -1) {
          document.body.className += " yui-skin-sam";
      var inityuicalendar1 = function() {
        var yuicalendar1 = new YAHOO.widget.Calendar("yuicalendar1");    // The following event subscribers demonstrate how to handle
        // YUI Calendar events, specifically when a date cell is
        // selected and when it is unselected.
        // See: http://developer.yahoo.com/yui/calendar/ for more
        // information on the YUI Calendar's configurations and
        // events.
        // The YUI Calendar API cheatsheet can be found at:
        // http://yuiblog.com/assets/pdf/cheatsheets/calendar.pdf
        //--- begin event subscribers ---//
        yuicalendar1.selectEvent.subscribe(selectHandler, yuicalendar1, true);
        yuicalendar1.deselectEvent.subscribe(deselectHandler, yuicalendar1, true);
        //--- end event subscribers ---//
    yuicalendar1.render();
      }  function selectHandler(event, data) {
      // The JavaScript function subscribed to yuicalendar1.  It is called when
      // a date cell is selected.
      // alert(event) will show an event type of "Select".
      // alert(data) will show the selected date as [year, month, date]. 
      var formattedDate = data[0][0][1] + "/" + data[0][0][2] + "/" + data[0][0][0];
      var dateFilterFunc = function(dsEvents, row, rowNumber)
    if (row["date"].search(formattedDate) != -1)
       return row; // Return the row to keep it in the data set.
    return null; // Return null to remove the row from the data set.
      dsEvents.filter(dateFilterFunc); // Filter the rows in the data set.
      };  function deselectHandler(event, data) {
      // The JavaScript function subscribed to yuicalendar1.  It is called when
      // a selected date cell is unselected.
      };      // Create the YUI Calendar when the HTML document is usable.
      YAHOO.util.Event.onDOMReady(inityuicalendar1);
    // EndWebWidget YUI_Calendar: yuicalendar1
      </script>
    <div spry:region="dsEvents">
      <table cellpadding="2" id="Events">
        <tr>
          <th spry:sort="name">Name</th>
          <th spry:sort="date">Date</th>
          <th spry:sort="starttime">Start Time</th>
          <th spry:sort="endtime">End Time</th>
          <th spry:sort="location">Location</th>
          <th spry:sort="type">Type</th>
          <th spry:sort="contact">Contact</th>
          <th spry:sort="@id">Id</th>
        </tr>
        <tr spry:repeat="dsEvents">
          <td>{name}</td>
          <td>{date}</td>
          <td>{starttime}</td>
          <td>{endtime}</td>
          <td>{location}</td>
          <td>{type}</td>
          <td>{contact}</td>
          <td>{@id}</td>
        </tr>
      </table>
    </div>
    </div>
    </body>
    </html>
    And here is my XML file:
    <?xml version="1.0" encoding="utf-8"?>
    <events>
    <event id="1">
      <name>Dreamweaver CS4 Intermediate</name>
      <date>10/15/2009</date>
      <starttime>8:00 am</starttime>
      <endtime>5:00 pm</endtime>
      <location>Room 1</location>
      <type>Training</type>
      <contact>Contact 1</contact>
    </event>
    <event id="2">
      <name>InDesign CS4 Advanced</name>
      <date>10/14/2009</date>
      <starttime>8:00 am</starttime>
      <endtime>5:00 pm</endtime>
      <location>Room 2</location>
      <type>Training</type>
      <contact>Contact 1</contact>
    </event>
    <event id="3">
      <name>Flex CS4 Data Services</name>
      <date>10/15/2009</date>
      <starttime>1:00 pm</starttime>
      <endtime>5:00 pm</endtime>
      <location>Room 2</location>
      <type>Meeting</type>
      <contact>Contact 2</contact>
    </event>
    <event id="4">
      <name>Another Dreamweaver CS4 Intermediate</name>
      <date>10/30/2009</date>
      <starttime>8:00 am</starttime>
      <endtime>5:00 pm</endtime>
      <location>Room 1</location>
      <type>Training</type>
      <contact>Contact 1</contact>
    </event>
    <event id="5">
      <name>Another InDesign CS4 Advanced</name>
      <date>10/29/2009</date>
      <starttime>8:00 am</starttime>
      <endtime>5:00 pm</endtime>
      <location>Room 2</location>
      <type>Training</type>
      <contact>Contact 3</contact>
    </event>
    <event id="6">
      <name>Another Flex CS4 Data Services</name>
      <date>10/28/2009</date>
      <starttime>1:00 pm</starttime>
      <endtime>5:00 pm</endtime>
      <location>Room 2</location>
      <type>Meeting</type>
      <contact>Contact 2</contact>
    </event>
    </events>

    Hi,
    Here is my code for attaching the event highlighting to the YUI calendar.  It is triggered via an observer everytime the SpryData region markup containing the event tooltips is regenerated on my first tab.  I've also include the code I wrote for adding tooltips based on SpryData. Note I amended the Sprytooltip.js dataset to speed up the rendering based on the tip Arnout gave me
    One thing I do which is not the default for YUI calendar is I namespace my calendar so I can access it whilst doing my Spry stuff.
    YAHOO.namespace("cal");
    YAHOO.cal.yuicalendar1 = new YAHOO.widget.CalendarGroup("yuicalendar1","yuical1group", {PAGES:12,START_WEEKDAY:1});
    var myObserver = new Object;
    myObserver.onPostUpdate = function(notify, data)
    // Get Spry Data into rows variable
    rows = Events.getData();
    // Yahoo YUI stuff
    YAHOO.cal.yuicalendar1.removeRenderers();
    for (var i = 2; i < rows.length; i++)
      // Convert in date format range that yui calendar recognises
      var s = new Date(rows[i]["StartDate"]);
      s = s.getMonth() + 1 + '/' + s.getDate() + '/' + s.getFullYear();
      var e = new Date(rows[i]["EndDate"]);
      e = e.getMonth() + 1 + '/' + e.getDate() + '/' + e.getFullYear();
      var cald = s + '-' + e;
      // Add highlight to range of cells   
      YAHOO.cal.yuicalendar1.addRenderer(cald, YAHOO.cal.yuicalendar1.renderCellStyleHighlight1);
        // Now add tool tips
    // Build array of contiguous dates based on HMC events
    // Now cycle through HMC events  
      eventDates = [];
      for (var r=2;r<rows.length;r++)
        startDate = new Date(rows[r]["StartDate"]);
        endDate = new Date(rows[r]["EndDate"]);
        while (startDate <= endDate)
         startDatestr = todayFormat(startDate);
           eventDates[startDatestr] = r;
         startDate.setDate(startDate.getDate() + 1);
    // cycle through each of the 12 months.
    for (var c=0;c<=11;c++)
        addTipFast(c);
    // now render
    YAHOO.cal.yuicalendar1.render();
    function addTipFast(c)
       // reference to calendar
       var calDate = new Date();
       var cal = YAHOO.cal.yuicalendar1.pages[c];
       var calID = cal.id;
       var calDates = cal.cellDates
       var selector = 'table#' + calID + ' td[class~="calcell"]'
       // return array reference to table cells that make up calendar
          tds = Spry.$$(selector);
       // Search for match on event table
         for (var r=0;r<calDates.length;r++)
        tYear = calDates[r][0];
        tMonth = calDates[r][1];
        if (tMonth == 0)
         tMonth = 12;}
       else
        tMonth = tMonth - 1;
        tDate = calDates[r][2];
        calDate.setFullYear(tYear,tMonth,tDate);
        nDate = todayFormat(calDate);
        if (eventDates[nDate] > -1)
         toolid = 't' + eventDates[nDate];
         var myele = new Array;   
         myele[0] = tds[r];
         var t = new Spry.Widget.Tooltip(toolid,myele,{offsetY:25});
    Spry.Data.Region.addObserver("tooltips", myObserver);
    The tooltips is a div region containing all my tooltips for the calendar and generated from my SpryData Events data
    <div id="tooltips" spry:region="Events">
            <div spry:repeat="Events" id="t{ds_RowNumber}" class="tooltipContent hide"> {Title} </div>
          </div>
    I generate a unique id for each tooltip that I can use with the tooltip widget when attaching the triggers from the calendar as above. It uses the spry data row number to achieve this.
    Hope this helps you with your highlighting and tooltips if you want them. Note I ignore my first two events for highlighting as their start and end dates spans years and just represent club stuff that happens every week. Otherwise initialise your i variable with var i = 0; in the loop.
    Just noticed if I use the calendar nav controls it drops the tooltips.  I'll need to add a YUI render event notifier to pick that up.
    Cheers
    Phil

  • Difference Between 0CREATED_ON and Today's date

    Hi Experts,
    I am new to BW and I have to accomplish the following requirement.
    We have a characteristic 0CREATED_ON and when the report is run we need to calculate the difference between today's date and 0CREATED_ON. Can you please advice on the best possible way to achieve the same. If it could be broken into the logical steps, it would be a great help!!
    Thanks for the help in advance.
    Regards
    PG

    Hi Piyush,
    When you create the query make sure  that  characteristic Created on is in rows . Select all other characteristics and keyfigures in your query as per your requirement. Now
    Step 1. Create a formula variable by replacement path on Created_on lets say FVCRON .
    Step2. Activate the business content variable "Formula Variable for Current Calendar Day - 0F_ADAY " . If it is already active you should be able to see in your formula variable list.
    Step3. create a Calculated Keyfigure  0F_ADAY - FVCRON .
    If you need individual steps on how to create formula variable or to activate business content variable or how to create a variable using customer exit let me know.
    Vijay .

  • Hide/disable a row of a list when "date" column is less than today's date.

    Hi,
    We are using a "Finalsubmitted" date column in my list. my requirement is once that date of Finalsubmitted column is expired(less than today's date), total row should be in hide/disable mode.Could you help me to achieve this.
    Thanks.

    that is a drop down, showing the results from another list based on our selection.
    We have used SP services for that.
    But, date conversion is wrong on  var pubdate= new date(dateselected.value) line.
    It is showing "NaN(Not a number)" . date format it is giving DDMMYYYY.
    But, i need MMDDYYYY. How can we convert in JavaScript.
    Plz check below code.
    <script language="javascript" type="text/javascript">
    $(document).ready(function()
    today = new Date();
    getTagFromIdentifierAndTitle("select","Lookup","Dates").onchange = function() {ChangeEvent1()};
    function ChangeEvent1()
    var dateSelected = document.getElementById("Dropdown ID");
    var pubdate = new Date(dateSelected.value);
    if(pubdate<=today)
    $("input[value$='Save']").attr('disabled', true); //button hides
    alert("Publishing Date should be greater than Today's Date");
    else
    $("input[value$='Save']").attr('disabled', false); //button shown
    function getTagFromIdentifierAndTitle(tagName, identifier, title) {
    var len = identifier.length;
    var tags = document.getElementsByTagName(tagName);
    for (var i=0; i < tags.length; i++) {
    var tempString = tags[i].id;
    if (tags[i].title == title && (identifier == "" || tempString.indexOf(identifier) == tempString.length - len)) {
    return tags[i];
    return null;
    }</script>

  • Using today's date in selectableRange of dateField

    i'm having issues with the dateField component. i would like
    to dynamically specify today's date as the rangeEnd of the
    selectableRange, but i can't seem to get it to work.
    can someone show me how to create a dateField component that
    does not allow you to select a date in the future?

    It was working for me before. I didn't create the instance
    using the UIObject method - it was just in the authoring
    environment.
    Don't ask me why this is necessary, but I think it will do
    what you want. You may want to take away the +1 if you just want it
    to be today. At the moment it includes tomorrow.

  • Entering today's date

    There surely should be a fast, convenient way to enter today's date in a Numbers spread. Haven't found one or reference to such and Numbers Help is no help on this one. Command-hyphen which does exactly that in FileMaker Pro, another Apple product, doesn't work in Numbers.
    Right now I'm copying another date to the clipboard, selecting the target field, paste, then revise — a very tedious process.
    Much appreciated.

    Morley,
    Make yourself a Keyboard Shortcut for the Insert > Date & Time command.
    Jerry

  • Assigning today's date to process flow start actvity

    Hi,
    I am trying to assign today's date to my process flow which will be used as a common load date for multiple transformations within the process flow. I'm at a loss on how to do this. Any help would be appreciated.
    Thanks

    You can add variable to the start acitivity or create stand alone variable(global for Process Flow) in the left side panel (where you see selected objects/events) and give the value of the variable as sysdate. Make sure the Literal property is set to false meaning it is not literally SYSDATE but the value of sysdate.
    It worked for me.
    - Manohar

  • Highlighting today's date

    In month view, iCal highlights today's date in light blue. For some reason, today's date is no longer highlighted on my iMac. How do I get the highlighting back? Also, how do I change the color of the highlighting?

    madtownwriter,
    Welcome to Apple Discussions.
    Highlighting of the current day is in pale blue the only display behavior that I have observed in iCal. That is to say the current day is dimly highlighted, almost to the point of being white and invisible. Many users have complained about the fact that it is too dim and needs to be darkened. Other selected days are highlighted in a dim almost white gray.
    Since your current day is apparently no longer being displayed even in light blue, your iCal preference may be corrupted. You can Quit iCal, find the com.apple.iCal.plist file in your Macintosh HD/Users/yourusername/Library/Preferences Folder, drag it to the Desktop, and log out/in or restart.
    I personally find the iCal Widget, and iCal Events to be helpful for the current day display.
    If you want/need a color change, you can submit OS X Feedback expressing your needs and desires.
    ;~)

  • How to use GregorianCalendar to get today's date?

    I am using the following code to get today's date? I'm curious whether there is a direct way for GregorianCalendar to get today's date?
    Thanks,
    java.util.Date today = new java.util.Date();
    Calendar cal_today = new GregorianCalendar();
    cal_today.setTime(today);
    System.out.println(" month = " + cal_today.get(Calendar.MONTH));
    System.out.println(" day = " + cal_today.get(Calendar.DAY_OF_MONTH));
    System.out.println(" year = " + cal_today.get(Calendar.YEAR));

    If you mean construct it with todays date and time, sure. Just call the contructor with no arguments. According to the API...Constructs a default GregorianCalendar using the current time in the default time zone with the default locale.

  • Can't selectively delete image datatype BLOB data on SQL Server

    Hi all,
    I have a huge amount of BLOB data on an SQL Server 2008 DB (10.0.5500), in a table with an image datatype column. I need to selectively delete it from datafiles using a where filter on the table.
    I tried to use UPDATETEXT dbo.TBL_EMAILOUTBOUND_DSC.DESC_RAWDATA
    @ptrval 0 NULL; 
    loading the pointer with a previous filtered select, according
    documentation it should work, but it's not true. Do I make any mistake or forget something? If you need I can show the hole script.
    Thank you in advance
    Andrea
    Andrea

    Great to hear that it worked out!
    Below is detailed data of test. Thank you all.
    sp_spaceused
    name rows
    reserved data
    index_size unused
    TBL_EMAILOUTBOUND_RD_NEW 4768        --> 8156504 KB
    8156128 KB 24 KB
    352 KB
    update table_name set LOBcolumnName = null;
    name rows
    reserved data
    index_size unused
    TBL_EMAILOUTBOUND_RD_NEW 4768        --> 2456 KB
    2112 KB 24 KB
    320 KB
    ALTER INDEX ALL ON tbl REORGANIZE 
    name rows
    reserved data
    index_size unused
    TBL_EMAILOUTBOUND_RD_NEW 4768        --> 176 KB
    144 KB 24 KB
    8 KB
    Andrea

  • In oracle rac, If user query a select query and in processing data is fetched but in the duration of fetching the particular node is evicted then how failover to another node internally?

    In oracle rac, If user query a select query and in processing data is fetched but in the duration of fetching the particular node is evicted then how failover to another node internally?

    The query is re-issued as a flashback query and the client process can continue to fetch from the cursor. This is described in the Net Services Administrators Guide, the section on Transparent Application Failover.

Maybe you are looking for