Check if the number in a text field will evaluate to a date format

I have a field FieldA, which contains 6 numbers, (even if the field is a text field). I need to know if that evaluate the numbers from the field to a real date in MMDDYY format. For example, if FieldA contains 060110, which would evaluate then to a real date from 01/06/10. However, if FieldA contains 130110, so this isn't a valid date and the test will indicate accordingly. I was thinking about using a case statement, but unsure of how to test if the numbers are evaluated to a valid date...

Sort of:

BOX WHEN FieldA = 'Date valid' THEN FieldA TO_DATE(FieldA, 'mm-dd-yyyy')

Any help is appreciated...

Thank you...
/* Formatted on 11/14/2011 4:03:53 PM (QP5 v5.149.1003.31008) */
CREATE OR REPLACE FUNCTION validate_date (in_dt VARCHAR2)
   RETURN VARCHAR2
IS
BEGIN
   FOR c IN (SELECT TO_DATE (in_dt, 'mmddrr') x FROM DUAL)
   LOOP
      RETURN 'Valid Date';
   END LOOP;
EXCEPTION
   WHEN OTHERS
   THEN
      RETURN SQLERRM;
END;

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

WITH t AS (SELECT '060110' fieldA FROM DUAL
           UNION ALL
           SELECT '130110' FROM DUAL)
SELECT CASE validate_date (fieldA)
          WHEN 'Valid Date' THEN TO_DATE (fieldA, 'mmddrr')
       END
          col1,
       validate_date (fieldA)
  FROM t;
COL1     VALIDATE_DATE(FIELDA)
6/1/2010     Valid Date
     ORA-01843: not a valid month

Published by: pollywog on November 14, 2011 16:03

Tags: Database

Similar Questions

  • Check the boxes based on the value in a text field

    Hello.

    I'm building a pdf form in Acrobat Professional X. I want to add JavaScript to two checkboxs to achieve the following objectives:

    If the value of a text field (TLigne) is equal to 61, 64, 66 or 67, the first box (PlanACheck) has the value of the object of an audit.  If the value of a text field (TLigne) is equal to 60, 62 or 63, the second box (PlanBCheck) has the value of the object of an audit.

    I have no other than copy and paste Javascript experience, so I'm not sure I use the right language to research. If anyone can provide guidance, I would be very happy.

    Thank you very much!

    Usually this kind of thing will run the custom calculation of the target field script, but the boxes is not a calculation script, so we'll use the text for field Validation script do, with this code:

    this.getField("PlanACheck").checkThisBox (0, (event.value == "61" | event.value == "64" | event.value == '66' | event.value == "67"));

    this.getField("PlanBCheck").checkThisBox (0, (event.value == "60" | event.value == "62" | event.value == "63"));

  • Try to retrieve the contents of a text field and use it in a conditional statement

    Hello world

    I have a form with a text field and a button. The text field is called "orderNo" and the button is called "genOrder".

    Initially, the text field is empty, and clicking on the button fills the text with an appropriate order number field.

    I have need to check the text field for the data (content) before you write the order number, in this way, if an order number is already present in the text field, it will be over written.

    My intention is to use an if / else structure to perform the tests, but I do not know how to retrieve the content of the text field (if the content is present!).

    If anyone can suggest how I can go about extracting the contents of a text field and then use it in an if / else statement it will be greatly appreciated.

    Kind regards

    DAVO

    currentOrderNo = this.getField("orderNo").value;

    If ("currentOrderNo == null | currentOrderNo ==" ") {}

    the field is empty, fill it with a new value

    } else {}

    the field is not empty, something else

    }

  • HELP - lost the button "calculate" in the "text field properties"! I try to summarize the total for separate text fields in a summary box.

    Help, please!  I try to summarize the total for separate text fields in a summary box, but have lost the tab 'calculate' in the 'text field properties area.  Any help would be greatly appreciated!

    When in forms editing mode (Tools > prepare form), select: more > return to the Acrobat form

    In the future, check the box 'this document requires signatures' when you choose at the beginning: Tools > form prepare

    unless you plan to use the form with eSign Document Adobe cloud service.

  • Is it possible for someone to insert a logo when you fill out a form to fill out? I'm looking for all the options under the button 'add a text field.

    I have created a form to fill out that is a contract, but I need a way for the person who is to fill the form to insert their logo.  Is it possible for someone to insert a logo when you fill out the form to fill out? I'm looking for all the options under the button 'add a text field.

    It is not possible within a text field, either. If they have Acrobat, they can use the built-in under Tools - editing content Add Image tool.

    If they drive XI or higher, they can use a button form field you will need to set up for them, but the image must be in PDF format.

  • Problems with the filling of a text field with 2 other fields data


    I have 3 domains Tools_1a_pri, Tools_1a_pri_other, Tools_1a_pri_txt.

    Tools_1a_pri is a drop-down list box with a predefined list. One of the options is the 'other '.  If 'Other' is selected, the text Tools_1a_pri_other field becomes visible for users to enter the name of the other tool.

    The Tools_1a_pri_txt is a text field with a calculation that shows a text indicating that no tool has been selected or the Tools_1a_pri & or Tools_1a_pri_other.

    When I select one of the predefined tools, everything works.  When I choose the other, it seems that nothing has changed.  Must I click another field before.  It's confusing for the user.

    Tools_1a_pri validate code
    this.getField("Tools_1a_pri_Other").display = event.value is "Other"? Display.visible: display.hidden;

    Computer Tools_1a_pri_txt code
    If nothing is selected, follow these steps
    If (getField("Tools_1a_pri").value.length < 2) {}
    event.target.textColor = color.red
    Event.Value = "no identified main tool";
    } else if (getField("Tools_1a_pri").value! = 'Other') {}
    If not do that if the other is selected
    event.target.textColor = color.black
    Event.Value = getField("Tools_1a_pri").value;
    } else if (getField("Tools_1a_pri").value = 'Other') {}
    If not do so if the other is not selected
    event.target.textColor = color.black
    GetField("Tools_1a_pri").value = Event.Value + "-" + getField("Tools_1a_pri_Other").value;
    }

    You have made the classic mistake of using the assignment operator in a statement instead of the comparison operator. Change this line:
    } else if (getField("Tools_1a_pri").value = 'Other') {}

    To do this:

    } Else if (getField("Tools_1a_pri").value == 'Other') {}

  • How to check if the selection is any text tho:

    Ok.. Another question:

    How to check if the selection is any text tho:

        if (app.documents.length != 0 && app.selection.length != 0 &&

         (app.selection[0].constructor.name=="Text"||app.selection[0].constructor.name=="Paragraph"))

    but sometimes the selection is 'textStyleRange', sometimes 'character' etc. is there a shortcut to check both?

    I usually do something like this:

    if ( app.documents.length && app.selection.length && app.selection [ 0 ].hasOwnProperty ( 'baseline' ) )
         alert ( "It's a text!" );
    

    Hope that helps.

    --

    Marijan (tomaxxi)

    http://tomaxxi.com

  • Referring to the value of a text field, not the legend

    How to refer to the value in a text field to make the data entered by the user "BOLD" / no fat without the caption of a field text in bold or not bold?

    Hello

    Two lines should do. The first turn the caption and the "BOLD" value, then the second changes the legend of back to normal:

    TextField1.font.weight = "bold";
    TextField1.caption.font.weight = "normal";
    

    Hope that helps,

    Niall

    Ensure the dynamics

  • change the visulas of a text field

    Hello!

    How do heck you change the attributes of a text field that is in a form. IM particularly interested in the color and size of the box itself. I guess that this is done in css, if so that the CSS properties do change?

    Thank you very much and MERRY CHRISTMAS!

    Does that help?

    http://articles.SitePoint.com/print/style-Web-Forms-CSS

    Martin

  • Try to highlight the rectangle of a text field

    I'm trying to point out the rectangle of a text field with an Annotation of the line, but I'm a bit confused.

    The first doubt is on the 'Square' vs 'Rectangle' annotations What is the difference between them? Adobe has those changed recently?

    I tried several variations of the following code snippet:

    var x 1 = textField.rect [0];
    var y1 =
    textField.rect [1];
    var x 2 =
    textField.rect [2];
    var y2 =
    textField.rect [3];

    var this.addAnnot({) = underline
    page: 0.
    type: 'Line ',.
    Rect: [x 1, y1, x 2, y1],.
    strokeColor: color.red,.
    strokeWidth: 160
    });

    What I get is a line of identity (e.g., 45 degrees) in the lower left corner.

    -Ramon

    The square rect sets top-left-x, top-left-y, down, left - bottom-left-y and x.

    For a line, it is left-x, left-y, x-right, right-y.

    So if you want the line to be under place, use the background values of the place to place the line.

  • The legend of a text field border

    Does anyone know how to get the edge of the legend of a text field and the value section is visible to a user of the form?  It's a bit confusing when someone enters a field, and there is no line between the legend, they can't change it, and the value, they need editing.

    Choose different skins for the field will make very clear. If you choose to have no appearance there is no deliniation between the two. You can set up to change the background color of the zone to enter and deliver it to the output. This technique will highlight the field that has the focus, and there is no doubt as to where the field stops and starts.

  • Create the hyperlink in a text field

    I have a form that collects data from a customer. The number of customers is their phone number. This issue is already known and stored in a "cPhone" text field in the form. After all data are collected on the form, I then need to browse the site of customers the last part of the url of the site corresponding to their phone number that is already stored in the field "cPhone. What I want to do is to create a hyperlink to the Web site, that ends in the number of customer phone and when you click it it will take you to this Web site. For example, the url of the Web site might be www.mywebsite.com/main/active/ and my clients, 'cPhone' telephone number is 800-555-5555, when some kind of action is taken, the two are combined, and then it takes me to this Web page.

    Is they are combined and an action is created to open a web link, or a hyperlink can be created on the page that can be clicked, or anything else in the meantime. Is this possible?

    Probably the simplest is to use a button. The action could be a JavaScript like:

    Script mouse upward to a button

    app.launchURL ("http://www.example.com/main/active/"+ getField("cPhone").valueAsString, true);

    In practice, you'll want to check the value of the number field phone to see that it is not empty and is over, but this should help you get started.

    You can use the buttonSetCaption method to set the label of the button to the URL, perhaps in the phone number field Validate event.

  • How to limit the length of a text field in a dialog box (ADM)

    Hi all

    I need to limit the length of a field in a dialog box (ADM) edit_text, but char_limit doesn't seem to work, it's my code the problem ?

    {
    char_width: 8.
    height: 100,.
    item_id: 'Rete ',.
    type: 'edit_text. "
    Multiline: true,
    char_limit: 5.
    Width: 500,
    }

    If not, maybe I can use events to do the same thing with the onKeyStroke event but I don't know how to use the event in a dialog box (ADM) or if it is still possible...

    Any idea?

    Thank you for your help.

    Phil

    There are two events that can be used to check the length of the text,

    The first is the action event for the text field, which is called when the field loses focus, it is a member of the purpose of dialogue with the same name as the item_id.  This event could also be used to update another field in the dialog box that indicates the number of characters, you may even have a small picture of alert which becomes visible to make it obvious that there is a problem.

    The other event, as already mentioned, is the validate event.  This allows to block the exit from the dialog box and display a popup to alert to the user.

    You will find some examples of dialogs here:

    http://www.pdfscripting.com/public/65.cfm

    Take a look at the pages resize tool dialog box.  It will give you some ideas of what can be done.

    There is a plug-in Acrobat for creating dialogs here:

    http://www.windjack.com/products/AcroDialogs.html

    It's a Visual drag and drop Editor.  You can download and use for free for 10 days.

    Thom Parker
    The source for PDF Scripting Info
    pdfscripting.com

    The Acrobat JavaScript Reference, use it early and often
    http://www.Adobe.com/devnet/Acrobat/JavaScript.html

    Then more important JavaScript development tool in Acrobat
    The Console window (video tutorial)
    The Console Window (article)

  • Click and drag in the Favorites or in text fields does not

    Click and drag does not work with favorites anywhere, or any text fields. He used to work a lot in v11, but not v12

    I tried to revert to my version of Firefox v11 backup but it keeps automatically updated to v12 despite disabling auto update in the preferences and even when it is offline - frustrating.

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance/themes).

  • How to set the focus to a text field.

    Hello
    I have a form that contains 5 textfields. When the form is loaded, by default, the cursor should be on the second field. How can I concentrate on the text field.
    I checked in the API of the TextField object, and it is observed that the focusedProperty is a read only field.

    Can someone let me know how to focus on the desired TextField. ?

    Thanks in advance.
    The SAI Pradeep.

    Use textField.requestFocus)

    If your node is not always lay out to the point because of a management of the default focus of the javafx platform, wrap the call for development in Platform.runLater

Maybe you are looking for

  • Goes on a trip - how to extend the battery life of my computer?

    So, I'm going on a trip soon on a bus and I want to be able to bring my computer, but it is running out of battery very fast. How can I save energy?

  • Replace the HARD drive with SSD on a T530 - noob question

    Hi all I have a T530 with conventional hard drive. I want to replace it with an SSD (probably Samsung 840 Pro). When I look at the replacement Web site instructions, they refer to the use of spacers during the installation of an SSD (as opposed to ru

  • DeskJet 3520 - print Invitations

    I use a HP Deskjet 3520 on a Windows 7 PC. I am currently trying to print an invitation 5.5 "x 8.5" on Word 2010 and little matter the customizations that I try to do through word itself or the properties of the printer, the output prints still on th

  • Cannot get the notification if the client has been disconnected and then become online

    Hello I use notification service Pap BB and I have send a notification to the customer of BB and he got the notification correctly while it is online. But if I send a notification, while the mobile was disconnected , then again online , no notificati

  • Search for a duplicate record

    HelloI want to find cases where the same dept and company are repeated for a particular ID. These ID, retrieve only records where status is (null or - 1) and the study = 1.I used the below SQL but it tooks times.Is there an alternative way to achieve