Script for the current date

I have a javascript document that worked. It prints the current date to the first opening the PDF file in a field called today. Subsequently, the date does not change no matter how many times the PDF file is opened.

var f = this.getField ("Today");
If (f.value == ' ') f.value = util.printd ("mm/dd/yyyy", new Date());

I'm using Acrobat 9 Pro and for some reason this script no longer works in version 9. If someone can help fix this sript, I would be very happy.

It works fine for me in Acrobat 9.2.0 (under Windows 7). If the field is empty when the form opens, it inserts the current date. If the field is not empty, it does nothing.

You are absolutely sure that the field 'Today' is empty when you open the PDF file?

Tags: Acrobat

Similar Questions

  • use Image catalog script for the current document

    Is it possible to use the script to image catalogue for the current document in which we work instead of leaving the mark of script a new document fees for placed images?

    use,

    //ImageCatalog.jsx
    //An InDesign CS6 JavaScript
    /*
    @@@BUILDINFO@@@ "ImageCatalog.jsx" 3.0.0 15 December 2009
    */
    //Creates an image catalog from the graphic files in a selected folder.
    //Each file can be labeled with the file name, and the labels are placed on
    //a separate layer and formatted using a paragraph style ("label") you can
    //modify to change the appearance of the labels.
    //
    //For more information on InDesign scripting, go to http://www.adobe.com/products/indesign/scripting/index.html
    //Or visit the InDesign Scripting User to User forum at http://www.adobeforums.com .
    //
    //The myExtensions array contains the extensions of the graphic file types you want
    //to include in the catalog. You can remove extensions from or add extensions to this list.
    //myExtensions is a global. Mac OS users should also look at the file types in the myFileFilter function.
    main();
    function main(){
      var myFilteredFiles;
      //Make certain that user interaction (display of dialogs, etc.) is turned on.
      app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
      myExtensions = [".jpg", ".jpeg", ".eps", ".ps", ".pdf", ".tif", ".tiff", ".gif", ".psd", ".ai"]
      //Display the folder browser.
      var myFolder = Folder.selectDialog("Select the folder containing the images", "");
      //Get the path to the folder containing the files you want to place.
      if(myFolder != null){
      if(File.fs == "Macintosh"){
      myFilteredFiles = myMacOSFileFilter(myFolder);
      }
      else{
      myFilteredFiles = myWinOSFileFilter(myFolder);
      }
      if(myFilteredFiles.length != 0){
      myDisplayDialog(myFilteredFiles, myFolder);
      alert("Done!");
      }
      }
    }
    //Windows version of the file filter.
    function myWinOSFileFilter(myFolder){
      var myFiles = new Array;
      var myFilteredFiles = new Array;
      for(myExtensionCounter = 0; myExtensionCounter < myExtensions.length; myExtensionCounter++){
      myExtension = myExtensions[myExtensionCounter];
            myFiles = myFolder.getFiles("*"+ myExtension);
      if(myFiles.length != 0){
      for(var myFileCounter = 0; myFileCounter < myFiles.length; myFileCounter++){
      myFilteredFiles.push(myFiles[myFileCounter]);
      }
      }
      }
      return myFilteredFiles;
    }
    function myMacOSFileFilter(myFolder){
      var myFilteredFiles = myFolder.getFiles(myFileFilter);
      return myFilteredFiles;
    }
    //Mac OS version of file filter
    //Have to provide a separate version because not all Mac OS users use file extensions
    //and/or file extensions are sometimes hidden by the Finder.
    function myFileFilter(myFile){
      var myFileType = myFile.type;
      switch (myFileType){
      case "JPEG":
      case "EPSF":
      case "PICT":
      case "TIFF":
      case "8BPS":
      case "GIFf":
      case "PDF ":
      return true;
      break;
      default:
      for(var myCounter = 0; myCounter-1){
      return true;
      break;
      }
      }
      }
      return false;
    }
    function myDisplayDialog(myFiles, myFolder){
      var myLabelWidth = 112;
      var myStyleNames = myGetParagraphStyleNames(app);
      var myLayerNames = ["Layer 1", "Labels"];
      var myDialog = app.dialogs.add({name:"Image Catalog"});
      with(myDialog.dialogColumns.add()){
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Information:"});
      }
      with(borderPanels.add()){
      with(dialogColumns.add()){
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Source Folder:", minWidth:myLabelWidth});
      staticTexts.add({staticLabel:myFolder.path + "/" + myFolder.name});
      }
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Number of Images:", minWidth:myLabelWidth});
      staticTexts.add({staticLabel:myFiles.length + ""});
      }
      }
      }
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Options:"});
      }
      with(borderPanels.add()){
      with(dialogColumns.add()){
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Number of Rows:", minWidth:myLabelWidth});
      var myNumberOfRowsField = integerEditboxes.add({editValue:3});
      }
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Number of Columns:", minWidth:myLabelWidth});
      var myNumberOfColumnsField = integerEditboxes.add({editValue:3});
      }
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Horizontal Offset:", minWidth:myLabelWidth});
      var myHorizontalOffsetField = measurementEditboxes.add({editValue:12, editUnits:MeasurementUnits.points});
      }
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Vertical Offset:", minWidth:myLabelWidth});
      var myVerticalOffsetField = measurementEditboxes.add({editValue:24, editUnits:MeasurementUnits.points});
      }
      with (dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Fitting:", minWidth:myLabelWidth});
      }
      with(dialogColumns.add()){
      var myFitProportionalCheckbox = checkboxControls.add({staticLabel:"Proportional", checkedState:true});
      var myFitCenterContentCheckbox = checkboxControls.add({staticLabel:"Center Content", checkedState:true});
      var myFitFrameToContentCheckbox = checkboxControls.add({staticLabel:"Frame to Content", checkedState:true});
      }
      }
      with(dialogRows.add()){
      var myRemoveEmptyFramesCheckbox = checkboxControls.add({staticLabel:"Remove Empty Frames:", checkedState:true});
      }
      }
      }
      with(dialogRows.add()){
      staticTexts.add({staticLabel:""});
      }
      var myLabelsGroup = enablingGroups.add({staticLabel:"Labels", checkedState:true});
      with (myLabelsGroup){
      with(dialogColumns.add()){
      //Label type
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Type:", minWidth:myLabelWidth});
      }
      with(dialogColumns.add()){
      var myLabelTypeDropdown = dropdowns.add({stringList:["File name", "File path", "XMP description", "XMP author"], selectedIndex:0});
      }
      }
      //Text frame height
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Height:", minWidth:myLabelWidth});
      }
      with(dialogColumns.add()){
      var myLabelHeightField = measurementEditboxes.add({editValue:24, editUnits:MeasurementUnits.points});
      }
      }
      //Text frame offset
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Offset:", minWidth:myLabelWidth});
      }
      with(dialogColumns.add()){
      var myLabelOffsetField = measurementEditboxes.add({editValue:0, editUnits:MeasurementUnits.points});
      }
      }
      //Style to apply
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Style:", minWidth:myLabelWidth});
      }
      with(dialogColumns.add()){
      var myLabelStyleDropdown = dropdowns.add({stringList:myStyleNames, selectedIndex:0});
      }
      }
      //Layer
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Layer:", minWidth:myLabelWidth});
      }
      with(dialogColumns.add()){
      var myLayerDropdown = dropdowns.add({stringList:myLayerNames, selectedIndex:0});
      }
      }
      }
      }
            var myResult = myDialog.show();
            if(myResult == true){
      var myNumberOfRows = myNumberOfRowsField.editValue;
      var myNumberOfColumns = myNumberOfColumnsField.editValue;
      var myRemoveEmptyFrames = myRemoveEmptyFramesCheckbox.checkedState;
      var myFitProportional = myFitProportionalCheckbox.checkedState;
      var myFitCenterContent = myFitCenterContentCheckbox.checkedState;
      var myFitFrameToContent = myFitFrameToContentCheckbox.checkedState;
      var myHorizontalOffset = myHorizontalOffsetField.editValue;
      var myVerticalOffset = myVerticalOffsetField.editValue;
      var myMakeLabels = myLabelsGroup.checkedState;
      var myLabelType = myLabelTypeDropdown.selectedIndex;
      var myLabelHeight = myLabelHeightField.editValue;
      var myLabelOffset = myLabelOffsetField.editValue;
      var myLabelStyle = myStyleNames[myLabelStyleDropdown.selectedIndex];
      var myLayerName = myLayerNames[myLayerDropdown.selectedIndex];
      myDialog.destroy();
      myMakeImageCatalog(myFiles, myNumberOfRows, myNumberOfColumns, myRemoveEmptyFrames, myFitProportional, myFitCenterContent, myFitFrameToContent, myHorizontalOffset, myVerticalOffset, myMakeLabels, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle,  myLayerName);
            }
      else{
      myDialog.destroy();
      }
      }
    }
    function myGetParagraphStyleNames(myDocument){
      var myStyleNames = new Array;
      var myAddLabelStyle = true;
      for(var myCounter = 0; myCounter < myDocument.paragraphStyles.length; myCounter++){
      myStyleNames.push(myDocument.paragraphStyles.item(myCounter).name);
      if (myDocument.paragraphStyles.item(myCounter).name == "Labels"){
      myAddLabelStyle = false;
      }
      }
      if(myAddLabelStyle == true){
      myStyleNames.push("Labels");
      }
      return myStyleNames;
    }
    function myMakeImageCatalog(myFiles, myNumberOfRows, myNumberOfColumns, myRemoveEmptyFrames, myFitProportional, myFitCenterContent, myFitFrameToContent, myHorizontalOffset, myVerticalOffset, myMakeLabels, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle,  myLayerName){
      var myPage, myFile, myCounter, myX1, myY1, myX2, myY2, myRectangle, myLabelStyle, myLabelLayer;
      var myParagraphStyle, myError;
      var myFramesPerPage = myNumberOfRows * myNumberOfColumns;
      var myDocument = app.activeDocument;
      myDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
      myDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
      var myDocumentPreferences = myDocument.documentPreferences;
      var myNumberOfFrames = myFiles.length;
      var myNumberOfPages = Math.round(myNumberOfFrames / myFramesPerPage);
      if ((myNumberOfPages * myFramesPerPage) < myNumberOfFrames){
      myNumberOfPages++;
      }
      //If myMakeLabels is true, then add the label style and layer if they do not already exist.
      if(myMakeLabels == true){
      try{
      myLabelLayer = myDocument.layers.item(myLayerName);
      //if the layer does not exist, trying to get the layer name will cause an error.
      myLabelLayer.name;
      }
      catch (myError){
      myLabelLayer = myDocument.layers.add({name:myLayerName});
      }
      //If the paragraph style does not exist, create it.
      try{
      myParagraphStyle = myDocument.paragraphStyles.item(myLabelStyle);
      myParagraphStyle.name;
      }
      catch(myError){
      myDocument.paragraphStyles.add({name:myLabelStyle});
      }
      }
      myDocumentPreferences.pagesPerDocument = myNumberOfPages;
      myDocumentPreferences.facingPages = false;
      var myPage = myDocument.pages.item(0);
      var myMarginPreferences = myPage.marginPreferences;
      var myLeftMargin = myMarginPreferences.left;
      var myTopMargin = myMarginPreferences.top;
      var myRightMargin = myMarginPreferences.right;
      var myBottomMargin = myMarginPreferences.bottom;
      var myLiveWidth = (myDocumentPreferences.pageWidth - (myLeftMargin + myRightMargin)) + myHorizontalOffset
      var myLiveHeight = myDocumentPreferences.pageHeight - (myTopMargin + myBottomMargin)
      var myColumnWidth = myLiveWidth / myNumberOfColumns
      var myFrameWidth = myColumnWidth - myHorizontalOffset
      var myRowHeight = (myLiveHeight / myNumberOfRows)
      var myFrameHeight = myRowHeight - myVerticalOffset
      var myPages = myDocument.pages;
      // Construct the frames in reverse order. Don't laugh--this will
      // save us time later (when we place the graphics).
      for (myCounter = myDocument.pages.length-1; myCounter >= 0; myCounter--){
      myPage = myPages.item(myCounter);
      for (var myRowCounter = myNumberOfRows; myRowCounter >= 1; myRowCounter--){
      myY1 = myTopMargin + (myRowHeight * (myRowCounter-1));
      myY2 = myY1 + myFrameHeight;
      for (var myColumnCounter = myNumberOfColumns; myColumnCounter >= 1; myColumnCounter--){
      myX1 = myLeftMargin + (myColumnWidth * (myColumnCounter-1));
      myX2 = myX1 + myFrameWidth;
      myRectangle = myPage.rectangles.add(myDocument.layers.item(-1), undefined, undefined, {geometricBounds:[myY1, myX1, myY2, myX2], strokeWeight:0, strokeColor:myDocument.swatches.item("None")});
      }
      }
      }
      // Because we constructed the frames in reverse order, rectangle 1
      // is the first rectangle on page 1, so we can simply iterate through
      // the rectangles, placing a file in each one in turn. myFiles = myFolder.Files;
      for (myCounter = 0; myCounter < myNumberOfFrames; myCounter++){
      myFile = myFiles[myCounter];
      myRectangle = myDocument.rectangles.item(myCounter);
      myRectangle.place(File(myFile));
      myRectangle.label = myFile.fsName.toString();
      //Apply fitting options as specified.
      if(myFitProportional){
      myRectangle.fit(FitOptions.proportionally);
      }
      if(myFitCenterContent){
      myRectangle.fit(FitOptions.centerContent);
      }
      if(myFitFrameToContent){
      myRectangle.fit(FitOptions.frameToContent);
      }
      //Add the label, if necessary.
      if(myMakeLabels == true){
      myAddLabel(myRectangle, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, myLayerName);
      }
      }
      if (myRemoveEmptyFrames == 1){
      for (var myCounter = myDocument.rectangles.length-1; myCounter >= 0;myCounter--){
      if (myDocument.rectangles.item(myCounter).contentType == ContentType.unassigned){
      myDocument.rectangles.item(myCounter).remove();
      }
      else{
      //As soon as you encounter a rectangle with content, exit the loop.
      break;
      }
      }
      }
    }
    //Function that adds the label.
    function myAddLabel(myFrame, myLabelType, myLabelHeight, myLabelOffset, myLabelStyleName, myLayerName){
      var myDocument = app.documents.item(0);
      var myLabel;
      var myLabelStyle = myDocument.paragraphStyles.item(myLabelStyleName);
      var myLabelLayer = myDocument.layers.item(myLayerName);
      var myLink =myFrame.graphics.item(0).itemLink;
      //Label type defines the text that goes in the label.
      switch(myLabelType){
      //File name
      case 0:
      myLabel = myLink.name;
      break;
      //File path
      case 1:
      myLabel = myLink.filePath;
      break;
      //XMP description
      case 2:
      try{
      myLabel = myLink.linkXmp.description;
      if(myLabel.replace(/^\s*$/gi, "")==""){
      throw myError;
      }
      }
      catch(myError){
      myLabel = "No description available.";
      }
      break;
      //XMP author
      case 3:
      try{
      myLabel = myLink.linkXmp.author
      if(myLabel.replace(/^\s*$/gi, "")==""){
      throw myError;
      }
      }
      catch(myError){
      myLabel = "No author available.";
      }
      break;
      }
      var myX1 = myFrame.geometricBounds[1];
      var myY1 = myFrame.geometricBounds[2] + myLabelOffset;
      var myX2 = myFrame.geometricBounds[3];
      var myY2 = myY1 + myLabelHeight;
      var myTextFrame = myFrame.parent.textFrames.add(myLabelLayer, undefined, undefined,{geometricBounds:[myY1, myX1, myY2, myX2], contents:myLabel});
      myTextFrame.textFramePreferences.firstBaselineOffset = FirstBaseline.leadingOffset;
      myTextFrame.parentStory.texts.item(0).appliedParagraphStyle = myLabelStyle;
    }
    
  • Need to retrieve the data for the current date.

    Hello

    I have a table which then retrieves information when using this command.

    Select ta_acct, shift, created_on track_alerts;

    Technicolor A 24 March 14

    Technicolor A 24 March 14

    Technicolor A 24 March 14

    Technicolor A 24 March 14

    Manitoba telecom a 24 March 14 system

    Technicolor A 24 March 14

    I used this statement to retrieve the data for the given date.

    Select ta_acct, shift, created_on track_alerts where created_on = 24 March 14 ';

    Its not data recovery.

    Need help.

    Kind regards

    Prasad K T,.

    984002170

    Prasad K T wrote:

    Yes the created data type is date.

    CREATED_ON DATE

    Partha thanks it works now.

    Select ta_acct, shift, created_on in track_alerts where to move is: Shift and TRUNC (created_on) = TO_DATE('24-MAR-2014','DD-MON-YYYY');

    Still, I made a small change to my querry.

    Select ta_acct, shift, created_on track_alerts where to move is: shft and TRUNC (created_on) = TO_DATE (select double sysdate,'MON-DD-YYYY "");

    For this statement, it does not work.

    of course not...

    first: sysdate returns a date so no need of conversion here

    and

    second SYSDATE includes time, so your application should look like this:

    Select ta_acct, shift, created_on in track_alerts where to move is: Shift and TRUNC (created_on) = trunc (sysdate)

    or

    Select ta_acct, shift, created_on in track_alerts where to move is: shft and created_on > = trunc (sysdate) and created_on<>

    HTH

  • Java code for the current date more than 30 days

    I searched this forum and google to see if I could get something to work with negative results. I created a form in Livecycle 8.2 and I'm trying to set a due date 30 days from today's date. When the form is opened, I have the date and time, read-only, displays so I also the expiry date to automatically display. I don't know anything about Java, and that I have used so far I was able to copy and paste to my form. Any help would be greatly appreciated.

    It was too complicated. All you need is:

    $ = Num2Date (date () + 30, ' MM/DD/YYYY')

  • Script for the content data store

    Hello

    I'm new in the world of Vmware of scripts.

    I used powercli and real working examples of scripts to find my way.

    I am trying to create an inventory of the existing infrastructure of vmware.

    I have a list of all the VMS and their data store, but I also need a data store content.

    As:

    a list of all the stores of data in a data center.

    Download all the contents of the data store (folders, files vmdk, iso files, other files)

    A list of all the folders / files with VMservers still known in the inventory.

    The goal is to know if there are any files/VMservers on the data store, which are no longer in use and to check if we have duplicate in other data stores files

    Thanks in advance for any assistance.

    Best regards

    Dany

    Take a look at the data store provider

    Try something like

    dir vmstore: \-recurse

  • change the color of the current date af:inputDate

    Dear experts,

    I have demands to change the color of a specific date in af:inputDate, but I can't find a way to change the date of the day color (04/09/205-JJ/MM/AAAA). Do you have any suggestions?

    I want the 09/04/2015 also green.

    selectedDate.png

    Thank you

    Ricky

    Hello

    AF | chooseDate::today The styles of the appearance of the cell of the table for the current date (today). For example, you can add a background color or a border to the cell.

    Pseudo classes Description
    selected

    JSPX page

    Below the code in skin file works for me, when we choose a date

    AF | {chooseDate::today}

    background-color: black;

    }

    Thank you

    Amey

  • Display the current Date on the topic title (TTITLE)

    I'm using sql * more to write a report. For the current date (and time if possible), I would like to be displayed in the title of my report (TTITLE.) It seems that I'm supposed to use a system variable called _DATE, but I don't know what to do.  I am under sql * more v.10.2.

    Here is my code. How can I include the current date to display in the side 'RIGHT' in the topic TTITLE?
    TTITLE ON
    TTITLE LEFT 'MY COMPANY' CENTER 'Weekly Invoice Totals for Cost Center: 10 - MANAGEMENT' RIGHT 'Date: ' 
    
    set pagesize 66
    set linesize 120
    set wrap off
    
    column vendor_name heading 'Supplier' format a40
    column invoice_num heading 'Invoice Number' format a30
    column invoice_amount heading 'Invoice Amount' format 999,999,999.99
    
    set underline =
    compute sum label TOTAL of invoice_amount on vendor_name
    break on vendor_name skip 2
    
    SELECT 
    po_v.vendor_name,
    ap_inv.invoice_num,
    ap_inv.invoice_amount,
    FROM
    ap.ap_invoices_all ap_inv,
    po.po_vendors po_v,
    WHERE
    ap_inv.vendor_id = po_v.vendor_id and
    ap_inv.creation_date > SYSDATE-10;

    Well, to date, you could use predefined SQL * more variable _DATE of substitution:

    SQL> TTITLE LEFT 'MY COMPANY' CENTER 'Weekly Invoice Totals for Cost Center: 10 - MANAGEMENT' RIGHT 'Date: &_DATE'
    SQL> SELECT 1 FROM DUAL
      2  /
    
    MY COMPANY                             Weekly Invoice Totals for Cost Center: 10 - MANAGEMENT                        Date: 22-JAN-10
             1
    ----------
             1
    
    SQL> 
    

    Unfortunately, it has not predefined SQL * more variable substitution for the moment. You will need to use a suggestion that Frank (or if you want the date in a different format).

    SY.

  • Insert the current date in the column of a table advanced

    Hello

    I created a ViewObject this query for the current date. Now please help me extract this date value and place in an advanced table column. The column comes after clicking on the button Add another line tha. After you click the date button value would automatically come in the column.

    Hello

    If (tableBean.getName () .equals (pageContext.getParameter (SOURCE_PARAM)))
    (& ADD_ROWS_EVENT.equals (pageContext.getParameter (EVENT_PARAM)))
    {
    ...
    }

    where tableBean is the handle to your table.

    Kind regards
    Out Sharma

  • PowerShell script to delete files based on the current Date

    I know using PowerShell Get-Date will look at the current date.  I would like to make a very basic PS Script that will remove a file over 8 days based on the current date.  According to me, with the help of a if/then the function will be necessary.  I am very new to scripting if Im not sure how the syntax is written.  Any help is appreciated.

    This issue is beyond the scope of this site and must be placed on Technet or MSDN

    http://social.technet.Microsoft.com/forums/en-us/home

    http://social.msdn.Microsoft.com/forums/en-us/home

  • How to get the last date of 3 days for the current month?

    Hello. Guy

    How to get the last date of 3 days for the current month?

    MY OUTPUT WOULD LOOK LIKE THIS

    JANUARY 29, 2016

    JANUARY 30, 2016

    JANUARY 31, 2016


    GUYS HELP ME / / /...

    SQL > select last_day (sysdate) - level + 1 double connect by level<= 3="" order="" by="">

    LAST_DAY)

    ---------

    29 JANUARY 16

    30 JANUARY 16

    31 JANUARY 16

  • change the current date for testing purposes.

    For testing purposes, we must be able to set the current date, mainly so that we can test 3 successive months, in about a period of 15 days.
    It's siebel-web-determinations (10,2) runnning under tomcat

    Other than changing the server clock or
    replace all occurrences in the rules where the date function perceive is used with a placeholder attribute as the temp "today's date"
    is there another way to change the current date for testing purposes?

    Thank you
    Allan

    Hi Allan

    An alternative would be to use the current date only once in your rules, for example: the date of assessment = the current date.

    Then, change the rest of your rules to use the valuation date instead of the current date. It works perfectly in production.

    If you set the value of the valuation date seeding date you want to use Siebel, then the current date function will not be triggered (you set a deducted directly attribute, so the rule proving this attribute will not run).

    See you soon

    Anthony

  • get the current date for condition satisfied

    Hello world

    I want to get the current date for the following query.

    SELECT B.NAME, C.FST_NAME, C WHERE S_CONTACT, S_ORG_EXT B, C.LAST_NAME OF S_PARTY_PER A (B.ROW_ID = A.PARTY_ID AND C.ROW_ID = A.PERSON_ID AND A.PERSON_ID IN (select D.NEW_VAL from the S_AUDIT_ITEM where D.OPERATION_CD = 'Associate' and OPERATION_DT = 'I want the current date from 07/10/2008 12:00:00 AM to 07/10/2008 23:55:55 '))

    Help, please...

    Hello

    Like this?

    SELECT B.NAME, C.FST_NAME, C.LAST_NAME
      FROM S_PARTY_PER A, S_ORG_EXT B, S_CONTACT C
     WHERE (B.ROW_ID = A.PARTY_ID AND C.ROW_ID = A.PERSON_ID AND
           A.PERSON_ID IN
           (select D.NEW_VAL
               from S_AUDIT_ITEM D
              where D.OPERATION_CD = 'Associate'
                and trunc(OPERATION_DT) = trunc(sysdate)
    --                'i want current date start from 10/7/2008 12:00:00 AM to 10/7/2008 11:55:55 PM'))
    
  • about the scripts for AWR report data!

    Hi all.


    The oracle's 10 g 2.

    I would like to extract the following data by issuing a query, and not by AWR report.

    ----------------------------------------------------------------------------------------------
    1 load of overall profile cache
    ~~

    2. global Cache efficiency percentages (target local + remote100%)

    Access - local cache buffer %: 99.91
    Access - remote cache buffer %: 0.07
    Access - disk buffer %: 0.02


    3. global Cache and messaging statistics - Enqueue Services
    ~~

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

    What is the data dictionary (DBA_HIST tables *) for the above data?

    You will be greatly appreciated if you give me an example of a query for them.

    Thanks in advance.
    Best regards.

    You can get the SQL code of sprepins.sql in $ORACLE_HOME/rdbms/admin

    Concerning
    Vincent

  • search for webApp: current date

    In the web app search field 'Date' must be the current date.

    Someone at - it an idea how to handle this?


    I'm trying to customize the DataPicker but without success.


    In fact, this is my Code:


    < form name = "catcustomcontentform24647" method = "post" onsubmit = "return checkWholeForm24647 (this)" action = "/ Default.aspx?" CCID = 16168 & FID = 125881 & ExcludeBoolFalse = True & PageID = {module_oid} ">"

    < table class = "webform" cellspacing = "0" cellpadding = "2" border = "0" >

    < b >

    < class td = 'h4-texttitel' > < select name = "CAT_Custom_1" id = "CAT_Custom_1" class = "cat_dropdown" >

    < option value = "*" > - Alle Themen - < / option >

    < option value = "What" > what < / option >

    < option value = "Concerts" > concerts < / option >

    < option value = "Konfprogramm" > Konfprogramm < / option >

    < option value = "Mittagstisch" > Mittagstisch < / option >

    < option value = "Jassnachmittage" > Jassnachmittage < / option >

    < option value = "Without" > without < / option >

    < option value = "Erwachsenenbildung" > Erwachsenenbildung < / option >

    < option value = 'Spiritualität' > Spiritualität < / option >

    < option value = "Kirchgemeindeversammlung" > Kirchgemeindeversammlung < / option >

    < / select > < table >

    < td > < input type = "text" name = "CAT_Custom_2_Min" id = "CAT_Custom_2_Min" class = "cat_textbox" readonly style = "" background-color: #F0F0F0; "onfocus ="displayDatePicker ('CAT_Custom_2_Min'); " return false; "placeholder =" mm/dd/yyyy"/ > < table >

    < /tr >

    < b >

    < td > < input class = "cat_button" type = "submit" value = "End all" / > < table >

    < /tr >

    < /table >

    < / make >

    < script type = "text/javascript" src="/CatalystScripts/ValidationFunctions.js?vs=b2004.r486545-phase1" > < / script >

    < script type = "text/javascript" src="/CatalystScripts/Java_DatePicker.js?vs=b2004.r486545-phase1" > < / script >

    < script type = "text/javascript" >

    function checkWholeForm24647 (theForm) {}

    var what = "";

    If (theForm.CAT_Custom_2_Min)

    If (theForm.CAT_Custom_2_Min.value.length > 0) why += checkDate (theForm.CAT_Custom_2_Min.value, "Datum");

    If (theForm.CAT_Custom_2_Max)

    If (theForm.CAT_Custom_2_Max.value.length > 0) why += checkDate (theForm.CAT_Custom_2_Max.value, "Datum");

    If (why! = "") {}

    Alert (Why);

    Returns false;

    }

    Returns true;

    }

    < /script >

    Thanks for the help

    I'm sure you still need that, but try to use global variables.

    {assign % = globals.site.dateNow | date-%}

    and for the entry 'CAT_Custom_2_Min' add value = {{today}}

  • How do I add 7 days to a date and compare it to the current date in a cfquery?

    I have classes that are no longer active once after the date of the class. However, the class should be displayed for seven days more in the backend. I tried to use the script below to get there, but I get an error "Variable DATE is not defined." I'm going in the right direction or is there a better way to do this?

    < name cfquery = "getClasses" datasource = "#application.dsn #" >

    Select *.

    (break the classReg INNER JOIN classReg.classID = classes.classID) INNER JOIN instructors ON classreg.instID = instructors.instID

    <!-adding seven days to the date of the class (date) by comparing the current date->

    where #DateFormat (DateAdd (would be ', 7, date), 'yyyy-mm-dd') # > #DateFormat (now (), 'yyyy-mm-dd') #.

    < / cfquery >

    where #DateFormat (DateAdd (would be ', 7, date), 'yyyy-mm-dd') # > #DateFormat (now (), 'yyyy-mm-dd') #.

    As Coldfusion said you, quite rightly so, he knows no variable called "date". You're in a request and, apparently, 'date' is a column name. So use the SQL functions instead of Coldfusion functions.

    In MySQL, the appropriate where clause is:

    WHERE DATE_ADD (date, INTERVAL of 7 DAYS) > CURDATE)

    In SQL Server, the appropriate where clause is:

    WHERE DATEADD(day,7,date) > GETDATE()

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

    Afterthought: I would rename the column 'date', as it is a reserved word in some database management systems

Maybe you are looking for