Date object validation

Hi All,
I've been looking at date and decision functions but I can't
seem to find one which will check if a certain value/variable is a
date object or not. I can't use IsDate 'coz this will only check if
a certain string can be converted to a date. What I mean is,
example, I will know that a certain value is a date object if that
value is returned by a Now() function or a
CreateDate/CreateDateTime function. These functions will return
date objects. But how do I check if a certain value is a date
object or not?
Example: Now() returns a date object, so this is a date
object. But if I manually input, say "2008-07-11", this is not a
date object since I just input it as a string.
Thanks.

quote:
Originally posted by:
Daverms
Hi,
Have you tried the
"CheckPattern"
udf?
I tried the udf, but still failed to give me the result I
want. By the way, is the "isDate" checking there suppose to
determine if it is a date object? It seems like it just looks for
patterns. I'm not sure though. What I am trying to achieve is to
validate a value/variable if it is a date object. Just like when
you want to validate a variable if it is an integer data type, or
maybe if it is a srting data type, or maybe it is a boolean data
type, etc. Maybe there is a core java for this? But how? What
function? Thanks.

Similar Messages

  • Entity Object validation for "Date" type

    I am trying to use the Entity Object validation for a Date field type, it is a required field.
    I am using the format: MM/dd/yy HH:mm:ss
    It is a simple validation where the date value must be less than or equal to the current date/time.
    I tried using "Query Result" validation where the date is LESS THAN the query SELECT SYSDATE FROM dual.
    This throws an error:
    JBO-27011: Attribute set with value 2006-07-09 14:05:53.0 for LksrSurveyDte in LCFSReportService.LeakDetailView1 failed.
    I have be unable to find help on validating dates using validation for an Entity Object and need some help.
    Thanks in advance.

    In your case you can implement a service method in the VO to check if any other reservation overlaps with the new one (which is not inserted in the db).
    I would use a an other VO (e.g. VODateCheck) for this. This VO has it's query build to check if a given roomid and a given startdate(time?) overlaps any other record for the roomid
    select * from ReservationRoom where RoomId=:bindRoomId and ReservationEnd>=:bindReservationStartIf this query returns one or more rows you have an overlapping in the schedule and throw an error.
    You call this VODateCheck from your service method in the other module before inserting the record. Set the bind variables in the VODateCheck and execute the query.
    Timo

  • Date wise Valid Customers

    Hi Experts,
    I have a customer master data object with move in date and move out date as attributes.
    Now I want a report for number of customers valid for each day of a specified user entry date range.
    Let say I have date in the object like below.
    cid              move-in-date           move-out-date
    1                   01 dec 2008           5 dec 2008
    2                   03 dec 2008           7 dec 2008
    Now in my report I need
    Date              valid customers.
    1st dec              1
    2nd dec              1
    3rd dec             2
    4th dec              2
    5th dec             2
    6th dec             1
    7th dec             1
    So how can I achieve this.
    Thanks in advance.

    Hi ,
    I dont think it is possible in reports.
    Try to create a extra field at infor provider itself and populate using abap code during loading itself.
    Construct report taking this field into consideration.
    Hope it helps,
    regards,
    anil

  • How to get year,month,date from a Date object?

    thanks

    The getTime() method will return the number of milliseconds since January 1, 1970, 00:00:00 GMT. You can then write a number of functions to calculate the date from this.
    The toString() function returns a string with the current value of the object - i.e 2002-10-17 (it's unusual formatting (YYYY-MM-DD) is useful when validating an input in real time, though beyond this, I've no idea why they put it this way around). You can then use string function substirng() to break this down into parts.
    i.e. if your Date object was called today:
    String DD = today.toString().substring()(8)
    String MM = today.toString().substring()(5,2)
    String YYYY = today.toString().substring()(0,4)
    There are other methods (see API) - but these have been deprecated - that means, although they can be used, they are not recomended.
    There is also a Calendar object, though this seems to have the same problems.
    Hope this helps :)

  • Date Object Issue in WebI

    Hello All,
    Currently I am facing an issue with Date Object in WebI. The data type of this specific object in Oracle (11g) is TimeStamp. If I use this object as one of the query filters in my report, I get "ORA-01843: not a valid month" error. I tried writing the custom sql with converting the format of the object to MM/dd/yyyy using TO_DATE function and it works well. Just wondering if there is any other solution that can be implemented at object level. The only solution I can think of is to use TO_DATE function and convert the object at the Universe level. Appreciate if there are any suggestions to handle this.
    Thanks,
    Sowrabha

    Hi Sowrabha,
    Are you hardcoding the date or passing it as a prompt?
    After passing the date value dont run it but check the SQL. What format do you get? Is it yyyy-mm-dd?
    Also try to pass the date in the prompt or filter as dd/MM/yyyy and check if it is working fine.
    It could be the case that the day which you are passing is becoming month in SQL. You might not face the issue with dates like 01/01/YYYY , 02/02/YYYY, ..... , 12/12/YYYY as 1,2,.....12 passed as month wont give any issue.
    The date format inside SQL is dependant on the database and can be checked in PRM file.
    Please check it and let me know.
    Regards,
    Yuvraj

  • Error while creating Logical Data Object Model

    Can anyone from Informatica help me on this ?

    Hello Everyone ,  I am creating new objects in Informatica BDE 9.6.1 . While  I trying to create a new Logical Data Object Model using the Customer_Order.xsd file  I am getting the error :  [MBCM_E0031 ]MIMB HOME directory is not valid .  I do not see anything in the drop-down list for Model Type .Kindly help .  RegardsSatyendra

  • Date Object as a key in Hash table

    Hi,
    I'm having a hash table with date object as key , the purpose is I can pick the value which is available in given date range. Consider the below example
    Coffee Powder[Code CODE1] - Effective 21-Jan & Expiry 20-Jun
    Coffee Powder[Code CODE1] - Effective 22-Jun & Expiry 30-Dec
    Meat[Code CODE2] - Effective 21 - Jan & Expiry 1 - Feb
    Meat[Code CODE2] - Effective 2 Feb &  Expiry 6 - Feb
    Currently I'm using the following hashtable & it has the structure Key - Code & Value [ List of objects] ]
    CODE1- List[ Coffe Powder - 21 Jan - 20 Jun , Coffee Powder - 22 Jun - 30 Dec ]
    CODE2- List[ Meat - 21 Jan - 01 Feb, Meat - 02 Feb - 06 Feb ]
    To get the value which is valid for the given date , i need to get the list by passing the code & iterate the list to get the best matched value.
    Example , if I want the Coffee Powder Information which is valid on 1 Feb. I need to get pass the code ( CODE 1 ) which will returns the list of objects. After we need to iterate the list to get the best match.
    Instead of iteration , is there any way to maintain the hashtable & get the results quicker..?
    Thx.

    To get a benefit out of the HashMaps quick access to keys you you'd need an exact match between your search date and a key date.
    Can you cluster your Map-Content? eg.: do you always serch for a complete month?
    Then you could change your Map from Map<Date,Object> to Map<Date,List<Object>> where Date is "normalised" to the first Day in month 00:00 o clock (UTC or local...).
    You could also consider an additional map (Map<Date,List<Date>>) where you group the actual keys of the original Map by the expected search clusters.
    bye
    TPD

  • MI 7.1 data objects push data to backend in some sequence

    Hi all,
    Let's say we have 2 data objects with no dependency between these. If we add instances of these data objects on the client in some sequence, can we be sure that these instances will arrive on DOE in the same order and will be processed in that order? Or do we actually have to define this order with report 'DOE_MAINTAIN_DO_SYNC_ORDER' ? But i've read on this forum that this is only for backward compatibility reasons... I find it rather strange that this sequence was easily be set in MI7.O with MI_MCD, but in MI7.1 it seams not. 
    In thread Re: How to set execution preferences between Data Objects, someone says that this will be encorporated in the DOE workbench (SDOE_WB) itself. We are on MI 7.1 SP9. Is this the case then? Were can we do these settings?
    Additional question:
    Let's say there is a dependency between these 2 data objects, then i know that download request for leading data object triggers download request of following DO. Does this also define the update order from client to DOE?
    thanks in advance,
    regards
    Peter

    Hi,
    I will answer your questions in the same sequence as posted by you.
    1. If the objects have no association between them: In this case whenever on the client any change is made to an object the state of the transaction is commited to the device outbound queue. It does not matter whether Obj1 was modified or object 2. The order in which the changes are done will be the order in which the transactions will be commited to DB and the same order will be used by MI to process these messages when client syncs.
    2. In case the objects have dependency: Here also the same principle works as in 1. Having a dependency between two objects technically drills down to having referential integrity between these objects. Lets say DO1 refers to DO2 instances. Then when you are saving DO1 your application would obviously ensure that it maintains the business referential integrity to DO2 else it will not even be a valid DO1 instance in your SAP Backend.
    Thus the order in which changes are done on the client is what determines the order of processing of these instances on the server.
    Regards,
    Vikas

  • Comparing java.util.Date objects...

    Hi,
    I got a problem using the follwing code:
    // get current date
    Date currentDate = new Date();
    // first check if column 'Date Actions Plan' has a valid value
    if (dl.getDate("actionsplanneddate", i) instanceof Date) {
    // then check if current date is after 'Date Actions Plan'
    if (currentDate.compareTo(dl.getDate("actionsplanneddate", i)) > 0) {
    I'd like to compare two Date objects - the first one is the current date and the second one is from a database column. The Date object of the database column has the following format (for example):
    2004-08-23 00:00:00
    The important thing is just the date (hours, minutes and seconds are not important in that case - therefore it is 00:00:00).
    I'd like to format the currentDate object in the same manner, which means setting hours, minutes and seconds to 00:00:00, too.
    Best regards
    - Stephan

    Hi,
    I got a problem using the follwing code:
    // get current date
    Date currentDate = new Date();
    // first check if column 'Date Actions Plan' has a
    valid value
    if (dl.getDate("actionsplanneddate", i) instanceof
    Date) {Why the instanceof? How would getDate not return a Date? (I'm assuming this is JDBC.)
    // then check if current date is after 'Date Actions
    Plan'
    if
    (currentDate.compareTo(dl.getDate("actionsplanneddate",
    i)) > 0) {
    I'd like to compare two Date objects - the first one
    is the current date and the second one is from a
    database column. The Date object of the database
    column has the following format (for example):If you have a java.util.Date or a java.sql.Date then it doesn't have format. It just represents an instant in time. Whatever format the DB uses or you used to create the date is not present in the Date object.
    You can use compareTo. I think Date also has before() and after() or isBefore()/isAfter() or something like that. Look at the API.
    Or you could call getTime() and compare the longs. Not sure why you'd want to do this though--I'm sure the other two idioms do this under the covers anyway.
    2004-08-23 00:00:00
    The important thing is just the date (hours, minutes
    and seconds are not important in that case - therefore
    it is 00:00:00).
    I'd like to format the currentDate object in the same
    manner, which means setting hours, minutes and seconds
    to 00:00:00, too.Ah. Well, then just creating a java.sql.Date from your java.util.Date might take care of that for you--I think the time portion is supposed to always be zero. Write some code and try it, but remember, it's GMT based, so you might see a nonzero time component, but it shoud match your TZ offset.
    Otherwise you'll have to use java.util.Calendar (java.util.GregorianCalendar)

  • Difference in Date Objects - Urgent

    How to find out the difference in two date objects?
    I have two date values : Start Date and End Date.
    I want to user to enter the dates in the range of 10 years gap only.
    I need a validation for this.
    can any one help me.
    Thanks
    Meghna

    use a gregorian calendar object (java.util.GregorianCalendar). add 10 years to you start date and check if the end date is before the result date.

  • MI: the data objects in the SCV dont have the active DOE triggered adapter

    We try to use SDOE_LOAD on MI7.1 to do the initial load.
    However, we get the error:
    "the data objects in the SCV dont have the active DOE triggered adapter."
    We cannot find a fix anywhere.
    Please help. thanks a lot!

    Hi,
    Assuming that you are using 7.1 in non-backward compatibility mode.
    1. The client post the update/delete/insert request to DOE in bound queue.
    2. The DoE post these messages to the BE.
    3. Meanwhile, after posting all the message client starts reading outbound messages in DoE till the outbound queue is empty.
    4. WHILE the client is reading outbound messages in 3. above the BE has validated the update/delete/insert request and posted a confirmation/rejection messages to DoE outbound queue the message will flow down to the client in the same sync cycle.
    However, if it's posted to DoE after the client has finishing syncing with DoE the message will flow down to the client in the next sync.
    So you see it cannot be guaranteed that the ocnfirmation/rehection message will flow down to the client in the same sync cycle.It may or may not happen.
    I hope this clarifies.
    Best Regards,
    Amit

  • ORA-10561: block type 'TRANSACTION MANAGED DATA BLOCK', data object# 237

    Hello,
    I encountered ORA-10561 while I was recovering my DB.
    Problem Background :-
    I took a hotbakup of my DB running in Windows, I edited the Pfile and recreated the control file
    I was able to succesfully mount the DB
    The I gave the below command to apply the redologs and recover the DB
    And the errors followed as mentioned.
    The HOTBACKUP was copied and restored using a USB-PENdrive. I suspect that the datafiles and / or ARCHIVE LOGS would have had some format issues due to O/S {WINXP ---> RHEL5}
    If this is the case ? then I would like to know how to convert the format of the files(Datafiles and or Redologs)
    into acceptable format
    >
    SQL> recover database until time '2010-03-15:18:08:05' using backup controlfile;
    ORA-00279: change 3447582 generated at 03/15/2010 17:41:42 needed for thread 1
    ORA-00289: suggestion : /home/oracle/NEW/ARCHIVE/ARC0000000144_0706577643.0001
    ORA-00280: change 3447582 for thread 1 is in sequence #144
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    /home/oracle/NEW/ARCHIVE/ARC00144_0706577643.001
    ORA-00283: recovery session canceled due to errors
    ORA-10562: Error occurred while applying redo to data block (file# 1, block#
    1658)
    ORA-10564: tablespace SYSTEM
    ORA-01110: data file 1: '/home/oracle/NEW/oradata/O1_MF_SYSTEM_5M9ZKSSW_.DBF'
    ORA-10561: block type 'TRANSACTION MANAGED DATA BLOCK', data object# 237
    ORA-00600: internal error code, arguments: [4502], [0], [], [], [], [], [], []
    >
    Thanks in advance.
    Regards,
    Valli

    You need to give much more information:
    What version of Oracle? 10gR2 is not a version, 10.2.0.1 is a version.
    What version of Windows, exactly? What version of linux?
    ORA-600 means you need to talk to Oracle support. There is an ora-600 lookup tool, which basically searches the knowledge base (for ora-600[4502] in your case, which brings up a bunch of really, really, really old docs).
    How exactly did you take the "hot backup?" There are a number of ways to do things with that name, some of which are just plain wrong.
    How exactly did you get the backup from one machine to another? Which exact commands did you use to copy the files to the usb and from the usb? Did you do it more than once?
    Why are you using the backup controlfile syntax? There are valid reasons, and invalid reasons to do that.
    What exactly did you change in the pfile?
    What does the alert log say about all this?

  • Problems with Date objects

    I want to use the HttpSession.getCreationTime() value and write it to an Oracle Date field.
    I am having trouble getting the value in the proper type and format.
    I have a test servlet to try to understand the various ways to use and convert DateTime values.
    Here's the code:
    response.setContentType("text/html");
    java.io.PrintWriter out = response.getWriter();
    HttpSession session = request.getSession();
    long logontime = session.getCreationTime();
    SimpleDateFormat formatter = new SimpleDateFormat("mm-dd-yyy hh:mm:ss");
    java.sql.Date sqlDate = new java.sql.Date(logontime);
    String sDate = formatter.format(sqlDate);
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Servlet</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("DateTime in Milliseconds: " + session.getCreationTime() + "<br>");
    out.println("DateTime as java.sql.Date: " + sqlDate + "<br>");
    out.println("java.sql.Date SimpleDateFormat: " sDate "<br>");
    out.println("</body>");
    out.println("</html>");
    out.close();
    Here's the output:
    DateTime in Milliseconds: 1016812138284
    DateTime as java.sql.Date: 2002-03-22
    java.sql.Date SimpleDateFormat: 48-22-2002 10:48:58
    What's happening with the Month in the SimpleDateFormat output?
    Also,
    How can I convert this string into a valid Date Object to use in CallableStatement.setDate(int index, Date x)?
    Thank you for your help.

    If you have a String that's in that format, and you want to convert it to a java.util.Date, you do something like this:SimpleDateFormat dateFormatter = new SimpleDateFormat("MM-dd-yyyy hh:mm:ss");
    java.util.Date date = dateFormatter.parse(thatString);Then if you want to convert that to a java.sql.Date, you do this:java.sql.Date sqlDate = new java.sql.Date(date.getTime());However, I suggest you don't actually want to do that. If your date has hours, minutes, and seconds in it then converting to java.sql.Date throws away that information. You may want java.sql.Timestamp instead.

  • Open Data Object -  Open File attachment within pdf document

    I am trying to build a script which will open file attachments embedded in a pdf document.
    I have used the following javascript to list all embedded files within a document so I can retrieve the name
    var d = this.dataObjects;
    for (var i = 0; i < d.length; i++)
    console.println("Data Object[" + i + "]=" + d[i].name);
    The console reported:
    Data Object[0]=MTP-300-X-1210_A.pdf
    Data Object[1]=MTP-300-X-1240_A.pdf
    I then used the following script to open the file     
    this.openDataObject("MTP-300-X-1210_A.pdf");
    Console reports back as follows and does not open the file:
    [object Doc]
    Can anyone please offer assistance in how to open an embedded pdf attachment within a document?
    Many thanks!

    Hi George,
    I have used the same method app.openDoc to open attachments using a path associated with my computer.  However, as you know, the method does not work if the pdf containing the attachment is located on a different computer.  The app.openDoc method throws an error becuase the path is not valid.
    I am trying to get the following code to work with no success:
    var cFilePath = "|" + this.path + "|U:photo.pdf"';   // photo.pdf is the attachment
    app.openDoc ({cPath: cFilePath});
    The debugger throws an error.
    However, if I take the content of the variable cFilepath and instert it as an argument within cPath parameter as a string literal, the app.openDoc method returns the docObject.
    What's going on here?  shouldn't the variable cFilePath work?  Or do I need to specify a data type for the variable?  Any thoughts would be helpful.  I am using Windows 7, Adobe Acrobat X Standard.

  • Problem with childs nodes and automatic key mapping in a Data Object

    Hi experts!
    I'm doing the service order tutorial from the mobile help at [this link|http://help.sap.com/saphelp_nwmobile71/helpdata/en/21/9b5b924c3b434fba4767731794b029/frameset.htm] and I have a problem...
    In the topic "Modeling the Equipment Data Object", says you have to mark the "Automatic Key Mapping" checkbox. So when I had to create a third child node ( the location node ) the system raised an exception with the message "Deselect automatic key mapping flag for more than two-level nodes". I'm trying deselecting the flag and creating the location node, but when I want mark again the automatic key mapping flag, this is disabled.
    What can I do to solve this and create the three child nodes with the flag marked? It's a configuration thing?
    Any help it's very welcome. Thanks in advance.
    Best regards,
    Simon.

    The thing is: Its not allowed to use automatic keymapping if you have more than two levels. This is why the message showed up, and this is why its been disabled.
    What automatic keymapping does: Figures out automatically which child node belongs to which parent (by guessing from the field name and type, which fields in the child correspond to which key fields of the parent).
    On three levels, this becomes more complicated => Its disabled.
    How to do keymapping yourself instead of having the DOE do it automatically: Do 'Explicit keymapping' from each child to its parent. Explicit keymapping is done by clicking on the corresponding menu button in the child node. Here you need to associate child node fields (they need not be key fields of the child, but they are allowed to be that as well) to each of its parent nodes key fields (so that each child can be associated to its parent).
    Cheers

Maybe you are looking for

  • Zen Micro installation problem - file "data2.cab" neede

    Hey Trying to install my Zen micro software when it says, " Please insert dist that contains the file data2.cab" I have the installation CD so why is file not on it'sDan

  • Modifying alarm setpoints dynamically

    How can I modify the alarm settings for my database points through a control in a Lookout application? For example I have a numeric value being monitored, and H and HH alarm points configured, but I want the operator to be able to modify these throug

  • Harpertown vs Nehalem upgrade?

    Hi there, I am about to upgrade from my MBP to a MP as I want to get into editing using FCP2. I have been patiently waiting for the Nehalem to arrive as I was told that would be the bee's knee's and should future proof me for the next few years. Howe

  • How to convert .mkv files to .avi to play on xbox 360

    just wondering if anybody can help me convert a .mkv file to .avi or something that will play on xbox 360.  oh yeah, i would like it to not cost me anything either lol.  thanks guys.

  • Uninstall Norton Virus & Utilities from OS X (10.2.8)

    What is the procedure for doing this? Which are the key Norton files to delete? Regards Graham