Scripting Functoid for Date Formatting in Maps Biztalk 2010
In the Source Schema I have the Date in xs: date Time Datatype in the Destination Schema I have date in String datatype. When I map directly I get the output as "2013-10-21T00:00:00". But I want it "2013-10-21" in output.
I tried using the scripting but nothing worked like,
public String ConvertEndDate(string param1)
return DateTime.Parse(param1).ToString("yyyy-MM-dd");
public string convertHireDate(string Date1)
return DateTime.ParseExact(Date1, "YYYY-MM-DDThh:mm:ss", null).ToString("yyyy-MM-dd");
Can anybody help me to deal with this. Thanks in advance.
Thanks AshwinPrabhu.But I have the Source Schema date in "2013-10-21T00:00:00" format in Destination I need as "2013-10-21".
I did the reverse like
public static string convertHireDate(string sdatetime)
return System.DateTime.ParseExact(sdatetime, "yyyy-MM-ddTHH:mm:ssZ", null).ToString("yyyy-MM-dd");
But getting Error like,
Exception type: XTransformationFailureException
Source: Microsoft.XLANGs.Engine
Target Site: Void ApplyStreamingTransform(System.Type, Microsoft.XLANGs.RuntimeTypes.TransformMetaData, System.Object[], System.IO.Stream[], Boolean)
The following is a stack trace that identifies the location where the exception occured
Additional error information:
Function 'userCSharp:convertHireDate()' has failed.
Exception type: XPathException
Source: System.Xml
Target Site: System.Object Evaluate(System.Xml.XPath.XPathNodeIterator)
The following is a stack trace that identifies the location where the exception occured
Exception type: FormatException
Source: mscorlib
Target Site: System.DateTime ParseExact(System.String, System.String, System.Globalization.DateTimeFormatInfo, System.Globalization.DateTimeStyles)
The following is a stack trace that identifies the location where the exception occured
at System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style)
at Microsoft.Xslt.CompiledScripts.CSharp.ScriptClass_2.convertHireDate(String sdatetime)
Similar Messages
-
Input Value long enough for date format ,Error in executing parallel query
Hi,
My Table: ANML( ID, STATUS,B_DATE,B_MONTH,B_YEAR, DEATH_DATE)
status 1 for alive and 2 for dead.
i wrote a view to get age.
as
create or relace view view1 as
select top."ID",top."STATUS",top."DOB",top."DEATH_DATE",top."ANML_AGE",top."DAYSDIFF",
CASE
WHEN anml_age < 1
THEN 'D'
ELSE 'M'
END age_unit,
CASE
WHEN anml_age < 1
THEN TO_CHAR (daysdiff || ' Day(s)')
WHEN anml_age < 12
THEN TO_CHAR (anml_age || ' Month(s)')
WHEN MOD (anml_age, 12) = 0
THEN TO_CHAR (ROUND (anml_age / 12, 0) || ' Year(s) '
ELSE TO_CHAR ( ROUND (anml_age / 12, 0)
|| ' Year(s) '
|| MOD (anml_age, 12)
|| ' Month(s)'
END age_string
from
(SELECT a.*,
CASE WHEN status IN ( 1)
THEN FLOOR(MONTHS_BETWEEN(TRUNC(SYSDATE),dob))
WHEN death_date IS NOT NULL AND status IN (2)
THEN FLOOR(MONTHS_BETWEEN(death_date,dob))
END anml_age,
CASE WHEN status IN (1)
THEN FLOOR(TRUNC(SYSDATE)-TRUNC(dob))
WHEN death_date IS NOT NULL AND status IN (2)
THEN FLOOR(TRUNC(death_date) - TRUNC(dob))
END daysdiff
from (
SELECTanml.id, status,
TO_DATE ( DECODE (b_date,
NULL, 1,
b_date
|| '-'
|| DECODE (b_month,
NULL, 1,
b_month
|| '-'
|| b_year,
'dd-mm-yyyy'
) DOB,
death_date
FROM anml
WHERE b_year IS NOT NULL
) a) top
when i tried to fetch all values from view its working fine.
But when i tried to fetch values based on condition like as follows,
select * from view1 where anml_age > 20 and anml_age<30
I am getting error like:
Input Value long enough for date format and Error in executing parallel query
Please tell me wht is wrong.Here is your formatted code
create or relace view view1 as
select top."ID",top."STATUS",top."DOB",top."DEATH_DATE",top."ANML_AGE",top."DAYSDIFF",
CASE
WHEN anml_age < 1
THEN 'D'
ELSE 'M'
END age_unit,
CASE
WHEN anml_age < 1
THEN TO_CHAR (daysdiff || ' Day(s)')
WHEN anml_age < 12
THEN TO_CHAR (anml_age || ' Month(s)')
WHEN MOD (anml_age, 12) = 0
THEN TO_CHAR (ROUND (anml_age / 12, 0) || ' Year(s) '
ELSE TO_CHAR ( ROUND (anml_age / 12, 0)
|| ' Year(s) '
|| MOD (anml_age, 12)
|| ' Month(s)'
END age_string
from
(SELECT a.*,
CASE WHEN status IN ( 1)
THEN FLOOR(MONTHS_BETWEEN(TRUNC(SYSDATE),dob))
WHEN death_date IS NOT NULL AND status IN (2)
THEN FLOOR(MONTHS_BETWEEN(death_date,dob))
END anml_age,
CASE WHEN status IN (1)
THEN FLOOR(TRUNC(SYSDATE)-TRUNC(dob))
WHEN death_date IS NOT NULL AND status IN (2)
THEN FLOOR(TRUNC(death_date) - TRUNC(dob))
END daysdiff
from (
SELECTanml.id, status,
TO_DATE ( DECODE (b_date,
NULL, 1,
b_date
|| '-'
|| DECODE (b_month,
NULL, 1,
b_month
|| '-'
|| b_year,
'dd-mm-yyyy'
) DOB,
death_date
FROM anml
WHERE b_year IS NOT NULL
) a) top -
NEED ALTER TABLE ALTER COLUMN FOR DATE FORMAT
Need something like this :
ALTER TABLE ABC
ALTER COLUMN DATE1 AS (DD/MM/YYYY)
need to appear in this format (29/03/2014) in the table.
also needs to be recorded in DB in that format.changed system date format, works. Thanks!
You should always store values as dates itself in date/datetime related field in SQLServer
The formatting can very easily be done in your front end (presentation layer) using format function
Even in T-SQL you can use CONVERT or FORMAT functions to get the date values in the format you want
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page
I don't follow you? Anyway, Olaf Helper's answer was the solution.
SQL Server has a data type called DATETIME. To correctly query dates, it is easier to use this as it allows the SQL engine to do all the calculations for you, also the canonical format for dates in any database language is YYYY-MM-DD, this ensures correctly
tiered dates that are stored in the right order. The way you store data and the way you display it should be kept as two seperate entities. This is the ISO standard and has been thoroughly investigated ...alot to say the least. This is where the term "front-end"
and "back-end" developers come from, and also the distinction between server-side and client-side scripting.
To cut a long story short, take the advice of the multiple professionals here, and follow standards otherwise you'll find yourself stuck, or worse, your legacy code will make someone tear their hair out. -
Scripting: browse for data files in a folder and all subfolders below
Hello,
i'm looking for a command to search for data files (*.dat) in a folder and all subfolders below.
I checked out command DirListGet. This command only search in the declared folder and not in the subfolders below.
Anyone an idea?
I don't want to use a loop-structure for finding subfolders and browse for the data files.
Mr. Buddydim result : result = DirListGet("C:\tmp", "*.dat", "filename", "FullFilenamesRecursive")
dim fl : for each fl in result
MsgBox fl
Next
Works fine for me and even recursive.
Alternatively but with mucg more effort and the same result.
Option Explicit 'Forces the explicit declaration of all the variables in a script.
dim folderPath : folderPath = "C:\tmp"
dim files : files = GetFileListRecursive(folderPath)
dim fl : for each fl in files
MsgBox fl
Next
Function GetFileListRecursive(folderPath)
dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
dim results : results = Array()
GetFiles fso, folderPath, results
GetFileListRecursive = results
End Function
Sub GetFiles(fso, folderPath, results)
dim folderObj : Set folderObj = fso.GetFolder(folderPath)
dim f : for Each f In folderObj.Files
if(0 = StrComp(fso.GetExtensionName(f), "dat", 1)) then
dim index : index = ubound(results) + 1
redim Preserve results(index)
results(index) = f.Path
End If
next
dim d : for Each d In folderObj.SubFolders
GetFiles fso, d.Path, results
next
End sub -
Class Cast Exception for Date Format .
Hi Friends ,
I am getting a error for casting type from Object to Date type .
Could you please some one help me . I am using a prepared statement in OAF for inserting a data .
All fields are inserting except Date format .
My code in controller as follows :
try { String StartDate=row.getAttribute("StartDate").toString();
// String StartDate="30-Apr-2011";
DateFormat formatter ;
Date StartDate1;
formatter = new SimpleDateFormat("dd-MMM-yy");
StartDate1 = (Date)formatter.parse(StartDate);
//System.out.println("Today is " +date );
pstmt.setDate(12,StartDate1);
} catch (ParseException e)
{System.out.println("Exception :"+e); }
Thanks in Advance ,
KeerthiThanks so Much for the quick response .
Exception Details.
oracle.apps.fnd.framework.OAException: java.lang.ClassCastException at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:888) at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1145) at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1408) at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2637) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418) at OA.jspService(OA.jsp:40) at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803) at java.lang.Thread.run(Thread.java:534) ## Detail 0 ## java.lang.ClassCastException at SONY.oracle.apps.inv.xx_slapg.webui.ServiceRequestCO.processFormRequest(ServiceRequestCO.java:153) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:799) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363) at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1118) at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363) at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363) at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363) at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2633) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418) at OA.jspService(OA.jsp:40) at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803) at java.lang.Thread.run(Thread.java:534) java.lang.ClassCastException at SONY.oracle.apps.inv.xx_slapg.webui.ServiceRequestCO.processFormRequest(ServiceRequestCO.java:153) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:799) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363) at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1118) at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363) at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363) at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363) at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2633) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418) at OA.jspService(OA.jsp:40) at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803) at java.lang.Thread.run(Thread.java:534)
Here is my code .
java.util.Date StartDate=(java.util.Date)row.getAttribute("StartDate");
------------------------------------------------------------------------------------------------ -
Parsing Issue in Filter For Date Format
Hi Folks,
I am having Parsing Issue on "Key Date" Object in Universe. See the Error and Code below for your review
Error: Parse Failed: Exception: DBD, The value entered is not valid. It must adhere to one of the following formats.
YYYYMMDD
DD.MM.YYYYState:N/A
Code:
<OPERATOR VALUE="AND"><OPTIONAL><FILTER KEY="0I_DAYIN"><CONDITION OPERATORCONDITION="Between"><CONSTANT TECH_NAME="@Prompt('Day Interval From','A','Calendar Day\LovDay IntervalBase',mono,primary_key)"/><CONSTANT TECH_NAME="@Prompt('Day Interval To','A','Calendar Day\LovDay IntervalBase',mono,primary_key)"/></CONDITION></FILTER></OPTIONAL><FILTER KEY="0P_KEYDA"><CONDITION OPERATORCONDITION="Equal"><CONSTANT TECH_NAME="@Prompt('Key Date','D',,mono,free)"/></CONDITION></FILTER></OPERATOR>
This universe is created by someone else and client need to modify it with a calendar but i did not modify it yet however its already giving me the hard time. Kindly advise, any kind of help will be appreciated
ThanksHi,
With the information provided I cannot for sure get to the error but here is what I would check.
Firstly, I was wondering if the 5th parameter in the @Prompt can be Primary_Key. I thought it would be either free or constrained.
Secondly, please the LOV values for the @ prompt are being populated from 'Calendar Day\LovDay IntervalBase'. So I would check the date format being used there.
Third, the To and From dates are alphaneumeric and not dates, so I am not sure how the comparision would happen.
Hope this helps.
Regards,
Madhur -
Sum values in last row for date format "hh24:mi"
Hi,
I have a big problem creating a sum row with date data.
I created a sql view where the result looks like that:
SELECT category_name,
user_name,
b_mmyyyy,
b_1, ..., b_31
FROM view_category_user_booking
category_name, user_name, b_1, ..., b_31
category1, user1, 122008, 01:00, ..., 03:30
category2, user1, 122008, 02:00, ..., 01:00
category3, user1, 122008, 00:00, ..., 00:15My goal is to integrate a sum row at the end for the columns b_1 ... b_31
category_name, user_name, b_1, ..., b_31
category1, user1, 122008, 01:00, ..., 03:30
category2, user1, 122008, 02:00, ..., 01:00
category3, user1, 122008, 00:00, ..., 00:15
Sum, user1, 122008, 03:00, ..., 04:45I tried it like that:
select decode(grouping(category_name),1,'Summe',category_name),
sum(to_number(replace(b_1,':',','))) as b_1,
sum(to_number(replace(b_31,':',','))) as b_31
from category_user_booking
where user_name = 'user1'
and b_mmyyyy = '122008'
group by rollup(category_name)But the result isn't really successful
category_name, b_1, b_31
category1, 1, 3,3
category2, 2, 1
category3, 0, 0,15
Sum, 3, 4,45Is there somebody with an idea?
Thanks ahead,
TobiasHi Avinash,
the problem is not the grouping it is the date format.
Instead of a value like 5,4 > I want 05:40 or 1,75 > I want 02:15 in the sum value.
In my table all time values are saved in the format hh24:mi.
I don't know how to get that via a sql statement.
Output I want:
category_name, user_name, b_1, ..., b_31
category1, user1, 122008, 01:00, ..., 03:30
category2, user1, 122008, 02:00, ..., 01:00
category3, user1, 122008, 00:00, ..., 00:15
Sum, user1, 122008, 03:00, ..., 04:45Regards,
Tobias -
Validating JTextField for Date Format
hello,
everybody.
i am trying to perform a validation on text field, i.e if the input is in a date format then it will show, other wise it will consume the character.
please help me out of this problem i am stucked with it.
waitng for reply. the following is my code.
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.util.*;
import java.text.*;
public class RilJDateField implements KeyListener
JFrame frame;
JPanel panel;
JLabel label;
JTextField text;
GridBagLayout gl;
GridBagConstraints gbc;
Date date = new Date();
public static void main(String a[])
new RilJDateField();
public RilJDateField()
panel = new JPanel();
gl = new GridBagLayout();
gbc = new GridBagConstraints();
panel.setLayout(gl);
label = new JLabel("Only Date Format");
text = new JTextField(5);
gbc.anchor = GridBagConstraints.NORTHWEST;
gbc.gridx = 1;
gbc.gridy = 1;
gl.setConstraints(label,gbc);
gbc.anchor = GridBagConstraints.NORTHWEST;
gbc.gridx = 2;
gbc.gridy = 1;
gl.setConstraints(text,gbc);
panel.add(label);
panel.add(text);
text.addKeyListener(this);
text.requestFocus();
frame = new JFrame("RilJDateField Demo");
frame.getContentPane().add(panel);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we)
System.exit(0);
frame.setSize(300,300);
frame.setVisible(true);
public void keyTyped(KeyEvent ke)
public void keyPressed(KeyEvent ke)
DateFormat df;
df = DateFormat.getDateInstance();
df = (DateFormat) ke.getSource();
if(!(df.equals(date)))
ke.consume();
public void keyReleased(KeyEvent ke)
}hi,
thanks very much, u gave me great idea.
according to ur suggestion i used JFormattedTextField as well as SimpleDateFormat, but while giving keyevent i am getting the error,
so please if possible reply for this.
the error is
java.lang.ClassCastException
at RilJDateField.keyTyped(RilJDateField.java:61)
at java.awt.Component.processKeyEvent(Unknown Source)
at javax.swing.JComponent.processKeyEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)and my source code is
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.util.*;
import java.text.*;
public class RilJDateField implements KeyListener
JFrame frame;
JPanel panel;
JLabel label;
JFormattedTextField text;
GridBagLayout gl;
GridBagConstraints gbc;
Date date = new Date();
SimpleDateFormat formatter;
public static void main(String a[])
new RilJDateField();
public RilJDateField()
panel = new JPanel();
gl = new GridBagLayout();
gbc = new GridBagConstraints();
panel.setLayout(gl);
label = new JLabel("Only Date Format");
text = new JFormattedTextField();
text.setColumns(10);
formatter = new SimpleDateFormat("dd mm yyyy");
gbc.anchor = GridBagConstraints.NORTHWEST;
gbc.gridx = 1;
gbc.gridy = 1;
gl.setConstraints(label,gbc);
gbc.anchor = GridBagConstraints.NORTHWEST;
gbc.gridx = 2;
gbc.gridy = 1;
gl.setConstraints(text,gbc);
panel.add(label);
panel.add(text);
text.addKeyListener(this);
text.requestFocus();
frame = new JFrame("RilJDateField Demo");
frame.getContentPane().add(panel);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we)
System.exit(0);
frame.setSize(300,300);
frame.setVisible(true);
public void keyTyped(KeyEvent ke)
Date date = (Date) ke.getSource();
if(!(date.equals(formatter)))
ke.consume();
public void keyPressed(KeyEvent ke)
public void keyReleased(KeyEvent ke)
} -
Obiee 11g upgrade issue for date format
Hi,
I am facing a date format issue with obiee 11g report. This statement cast(cast(current_date as char) as timestamp) is failing with "not a valid month" error in obiee 11g. This worked fine with obiee 10g.
I am basically trying to set the date to 12:00:00 am of the sysdate. Below is what I am trying to achieve:
timestampadd(sql_tsi_hour, 1, cast(cast(current_date as char) as timestamp)))
the above statement fails in obiee 11g.
Thanks for your help,
API dont think you need any functions to get the required output, try to set the date format as below
[FMT:timeStampShort]
If helps mark
Thanks
Edited by: Srini VEERAVALLI on Apr 23, 2013 4:18 PM
I think with format and then the below should work with no issues.
timestampadd(sql_tsi_hour, 1,current_date)
I think you are wasting time by posting here, just do it. You no need any ones permissions to do it ;)
Edited by: Srini VEERAVALLI on Apr 24, 2013 8:55 AM -
Hi Friends,
Could you guys help me with sample code in java script to throw error message if the user enter the wrong date format( my requirements of date format like yyyymmdd)in BSP.
Regards
CSM Reddyyou dont have to write the js code.
just set the input field<b> type = date</b> and <b>dovalidate=true</b>
if the user tries to submit the form with wrong format, the system will throw javascript error message and will not submit the form.
Regards
Raja -
Hi,
Could anybody assist me, the date format is like 20080519, but it should be in the format of 19.05.2008.Is there any function module .
Thanks in advance.
Regards.
I.Reddy Prasad.Hi,
CALL FUNCTION 'CONVERT_DATE_TO_INTERN_FORMAT'
EXPORTING
DATUM = W_DATE1
DTYPE = 'DATS'
IMPORTING
IDATE = W_DATE2.
Month in words
Date Format (month in words, day and year in number)
Regards
Adil -
Function module for date format
Hi,
what is the function module name to get the date format in <b>(dd.mm.yyyy)</b> from (<b>dd-mon-yyyy)</b>
Thanx.try this Fm
CONVERSION_EXIT_SDATE_INPUT
input as dd-mon-yyyy
28FEB2007
im assuming mon in literal format.
output is 20070228
WRITE STATEMENT WILL DISPLAY THE DATA IN DEFALUT DATE FORMATS OF SU3 .
<b>Elaborate teh query with an example .</b>
check this
regards,
vijay. -
How to declare data type for DATE format
Hi,
I need the data format in this format DD-MM-YYYY HH:MI:SS
So, I m using select TO_CHAR(Date_Column, 'DD-MM-YYYY HH:MI:SS') from dual;
Now, In my procedure I need to assign this to a OUT variable, what should be the Data type of out variable.
My OUT variable is used by other program.
ThanksYou can use VARCHAR2. Try the below
CREATE OR REPLACE PROCEDURE proc_test(p_indate DATE, p_outdate OUT VARCHAR2)
AS
BEGIN
p_outdate:= TO_CHAR(p_indate,'DD-MON-YYYY HH:MI:SS');
END;
SET SERVEROUTPUT ON
DECLARE
v_date VARCHAR2(50);
BEGIN
proc_test(SYSDATE,v_date);
DBMS_OUTPUT.PUT_LINE(v_date);
END;
OUTPUT:-
anonymous block completed
15-JAN-2014 12:13:46 -
Is there a function that reads a string and can return yes/no if the string matches a specified date format (example: mm/dd/yy)? I wish to avoid parsing the string character by character.
Thanks,
GeorgeBTW,
I used the following example code available from this site. I was able to easily modify it to sovle my problem.
try {
SimpleDateFormat formatter =
new SimpleDateFormat("EEEE, MMMM dd, yyyy");
Date d = formatter.parse(
"Tuesday, January 03, 1956");
formatter = new SimpleDateFormat(
"EE, MMM d, yy");
d = formatter.parse("Tue, Jan 3, 56");
formatter = new SimpleDateFormat(
"EE, MM d, yy");
d = formatter.parse("Tue, 01 3, 56");
process(d);
} catch (ParseException e) {
On to the next challenge...
George -
Transformations for Date Format
I have a flat file which contains a field for date as 02-10 for MMYY, how can I change it to 0210, can I use formula builder?
Hi,
Copy and Past teh below program, and implement the same logic for your requirements.
REPORT ZBITEST.
Data: zdd type sy-datum,
zmm(2) type n,
zyy(4) type n,
zd(2) type n,
zdm(6) type n.
zdd = sy-datum.
zd = zdd+6(2).
zmm = zdd+4(2).
concatenate zd zmm into zdm.
write:/ zdd.
write:/ zd.
write:/ zmm.
write:/ zdm.
Thanks
Reddy
Maybe you are looking for
-
If i want to buy a macbook charger, how much would i cost?
if i want to buy a macbook charger, how much would i cost?
-
Saving as .gif with transparency
I have a .png file with a transparent background which I have been trying to export as a .gif with transparency in FW8. I've managed to save it as a .gif but the edges are dreadfully ragged. I seem to have tried all the options. Any ideas please?
-
Can't get external cd burner to work on mac
Hello! I am new to owning a macbook pro and still getting used to it. I recently bought an external cd drive to hook up to the computer. When I plug it in and if I put a movie in, it will automatically play the movie. However, when I go into Itune
-
My IPhoto drops out for now reason
My IPhoto on my MacBook Pro keeps dropping out when I am trying to organize family pictures. How can I fix this problem or what suggestions can anyone give me to resolve my problem? Thanks
-
I have a Kensington wireless keyboard and mouse made for the mac, which works off of a wireless receiver/usb as opposed to bluetooth. Whenever I swith users, the mini wants me to identify the keyboard by pressing the buttons to the left and right of