Extract Year (only) from Date Field and Display in Text Field
I need to extract the year from a user entered date field and display the year in a text field. Can someone help me with the correct script to do this?
Hi,
that's quite easy to realize with FormCalc.
In you date fields exit event add the following code:
textField1 = Num2Date( Date2Num($.formattedValue, "MM/DD/YYYY"), "YYYY")
Note: This sample assumes that your date field formats the date with "MM/DD/YYYY". You may have to change the pattern to make it work at your end.
Similar Messages
-
I get a dialogue box asking "What should Firefox do with this file" Options open with or save file. My wife selected save file and now it only opens note pad and displays the text of the file to be saved. OK in windows Internet Explorer.
P.S. Site is http://www.coldwatercreek.com
-
How to set "Display as Text" field with AJAX select list
thanks Denes for your posting. I'm trying to use the Denes Kubicek code to populate a "Display as Text" field. It works for Text Field (disabled), but not "Display as Text" field(saves state) . In my applciation I need to show this field only (not the disabled text box) when a select list value is changed. any ideas to modify the code below are appreciated.
http://htmldb.oracle.com/pls/otn/f?p=31517:80:3418128396960418::NO
here is the code from the url above
1. Create an Application Process - getDet:
DECLARE
my_det VARCHAR2 (200);
BEGIN
SELECT ename || CHR(10) || job || CHR(10) || mgr
INTO my_det
FROM emp
WHERE empno = :P80_EMPLOYEES;
HTP.prn (my_det);
END;
2. Put the following in the Region Header of your page:
<script language="JavaScript" type="text/javascript">
function f_getDet ()
var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getDet',0);
get.add('P80_EMPLOYEES',html_GetElement('P80_EMPLOYEES').value)
gReturn = get.get();
if(gReturn)
{ html_GetElement('P80_DETAILS').value = gReturn }
else
{ html_GetElement('P80_DETAILS').value = 'null' }
get = null;
</script>
3. Put the following in the HTML Form Element Attributes of :P80_EMPLOYEES:
onChange="f_getDet()";Arie,
this works fine on normal page, except page zero. I have the AJAX select list and "Display as Text" field on page zero. The "Display as Text" field doesn't show the the value when AJAX select is changed. I'm using similar code as used in my other APEX page on OTN site. I tired to display the gReturn value, just before calling "setDisplayOnlyNode" function in the code below and it's showing correct value, but fails to display the value in the APEX field on page zero. Any ideas are appreciated.
Thanks,
Surya
<script language="JavaScript" type="text/javascript">
function setDisplayOnlyNode(pItem, pValue)
{ var textNode = pItem + '_DISPLAY'; $x(textNode).innerText = pValue; }
function f_getDet ()
var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getDet',0);
get.add('P1_EMPLOYEES',html_GetElement('P1_EMPLOYEES').value)
gReturn = get.get();
if(gReturn)
{ setDisplayOnlyNode('P1_DETAILS',gReturn)}
{ html_GetElement('P1_TEST').value = gReturn }
get = null;
</script> -
How do I retrieve all data from a table and display it on a text area?
I want to retrieve all the data from one of my MS Access data table and display them all in a text area. how do i go among doing this?
In my car table i have the fields lined up like this..
license,color,doors and year_made
I have an Object class called CAR that will contain methods to set the data from these fields when it gets retrieved.
here's what i go so far.....
statement = getDBConnection().createStatement();
rs = statement.executeQuery("select * from car");
boolean moreRS = rs.next();
if(moreRS)
car.setLicense(rs.getLong(1));
car.setColor(rs.getString(2));
car.setDoors(rs.getString(3));
car.setYearMade(rs.getString(4));
//but this will only get me one car. How do I get more car data?
HELP!!Vector cars = new Vector();
while (rs.next()) {
String license = rs.getLong(1);
String color = rs.getLong(2);
String doors = rs.getLong(3);
String year = rs.getLong(4);
myTextArea.append(license+"\t"+color+"\t"+doors+"\t"+year+"\n");
Car car = new Car();
car.setLicense(license);
car.setColor(color);
car.setDoors(doors);
car.setYearMade(year);
cars.add(car);
}t=tab
n=newline
Vector: http://java.sun.com/j2se/1.4.1/docs/api/java/util/Vector.html -
BI- Extract Hour:Min from date and get Avg
Hi there,
am working on BI answer and trying to get the average of the working hours of the departments. The Working Hrs column is Date format in the Database. And I managed with Forum help to Extract the Hours from this column and do the average through the BMM in the RPD on the Fact table as following:
EXTRACT( HOUR FROM "Ain_Access"."Fact_Access"."Working Hours")
Now on the BI Answer results I have 8 instead of 08:57.
But what I need is to Extract the Hour and the minuets and get their AVG.
Appreciate your help,Averaging column with date/time format in BI Answer
this expression will work:
(60 * EXTRACT( HOUR FROM "Ain_Access"."Fact_Access"."AVG Working Hours" ) + EXTRACT( MINUTE FROM "Ain_Access"."Fact_Access"."AVG Working Hours" )) / 60
but only if this "AVG Working Hours" is DATE type.... and this look like strange name fore DATE? "AVG" is average, aren't?
Arent u need to use "Working Hours" instead of "AVG Working Hours" ?
like this:
(60 * EXTRACT( HOUR FROM "Ain_Access"."Fact_Access"."Working Hours" ) + EXTRACT( MINUTE FROM "Ain_Access"."Fact_Access"."Working Hours" )) / 60
all best
phenix -
Search result to get data from bing search and display it in sharepoint page.
I have configured result source which gets data from bing site,i have given following url as source url
http://www.bing.com/search?q={?searchterms}&format=rss&Market=en-Us
but it returns only 8 results from RSS. i want to get all results of search and display it in my SharePoint search results page.
any pointers will be helpful.Hi,
According to your post, my understanding is that you wanted to search result to get data from bing search and displayed it in sharepoint page.
To display more items, you can modify the item number when you add
New Query Rule.
To get all results, I recommend to use the “Show More”
link in the result page.
You can enter the URL when you add New Query Rule:
"More" link goes to the following URL: http://www.bing.com/search?q={searchterms}
Here is a great blog for your reference:
http://sharepoint-community.net/profiles/blogs/integrate-bing-with-sharepoint-online-2013-search
Best Regards,
Linda Li
Linda Li
TechNet Community Support -
Help! Read raw Image data from a file and display on the JPanel or JFrame.
PLEASE HELP, I want to Read Binary(Raw Image)data (16 bit integer) from a file and display on the JPanel or JFrame.
Hey,
I need to do the same thing. Did you find a way to do that?
Could you sent me the code?
It's urgent, please.
My e-mail is [email protected] -
New to iCloud and Lion. Can I update via iCloud only from my iMac and have data flow to my iPhone and my MacBook, not the other direction?
No. Syncing means bringing both ends to be the same.
-
Merging seperate date and time fields into a unique text field.
I have a dropdown Calendar Date field and a dropdown Time Field in a form and I want to create an additional Text Field that displays the combination of these two fields as a unique form field that would look like this...
Arrival Date: 1/27/2009 Arrival Time: 11:30 AM
Record Number: This would be calculated from the two fields as (012720091130)
Also when you press the submit button the XML file name would be the Record Number (this would be a coded filename to correspond to the time of arrival).
Any Ideas?Creating the Arrival time string should be easy. Its a case of adding a number of strings together. Assuming the date is held ina field called dateField and the time is in a field called timeField the javascript expression woudl look like this:
TargetField.rawValue = "Arrival Date: " + dateField.rawValue + " Arrival Time: " + timeField.rawValue;
To get the recordNumber you will have to parse the unwanted chars out of the strings then add the two together just like above.
The data file name will be the same as the PDF file that it came from. You cannot change the name of it easily without certifying the document (and that brings in its on set of problems). -
How to use same Data Type and Length for two fields
How to use same data type and length for two fields when using 'FOR ALL ENTRIES IN' in a select statement? For instance the select queries are :
SELECT bukrs gjahr belnr lifnr budat bldat zlspr dmbtr waers shkzg
FROM bsik
INTO TABLE it_bsik
WHERE bukrs = p_bukrs
AND lifnr IN s_lifnr.
IF it_bsik IS NOT INITIAL.
SELECT belnr gjahr awkey awtyp
FROM bkpf
INTO TABLE it_bkpf
FOR ALL ENTRIES IN it_bsik
WHERE belnr = it_bsik-belnr
AND gjahr = it_bsik-gjahr.
IF it_bkpf IS NOT INITIAL.
SELECT belnr gjahr lifnr xblnr
FROM rbkp
INTO TABLE it_rbkp
FOR ALL ENTRIES IN it_bkpf
WHERE belnr = it_bkpf-awkey+0(10)
AND gjahr = it_bkpf-awkey+10(4).
ENDIF.
ENDIF.
Here it gives an error in the 3rd select query that 'When you use the addition "FOR ALL ENTRIES IN itab", the fields "GJAHR" and "IT_BKPF2-AWKEY+10(4)" must have the same type and the same length.'
Kindly clarify.Hi Saurabh,
Please see the example code that I have developed for you. It will help you solve the problem.
REPORT ZTEST_3 .
tables : BKPF.
data : begin of it_bkpf occurs 1,
belnr type RE_BELNR,
awkey type awkey,
awtyp type awtyp,
gjahr type GJAHR,
end of it_bkpf.
data : begin of it_bkpf1 occurs 1,
belnr type RE_BELNR,
awkey type gjahr, " change the data type
awtyp type awtyp,
gjahr type GJAHR,
end of it_bkpf1.
data : begin of it_rbkp occurs 1,
belnr type BELNR_D,
gjahr type gjahr,
lifnr type LIFRE,
xblnr type XBLNR,
end of it_rbkp.
select belnr
awkey
awtyp
gjahr
from bkpf
into table it_bkpf
where BUKRS = 'TELH'.
loop at it_bkpf.
it_bkpf1-belnr = it_bkpf-belnr.
it_bkpf1-awkey = it_bkpf-awkey+10(4). "Here only append the required length.
it_bkpf1-awtyp = it_bkpf-awtyp.
it_bkpf1-gjahr = it_bkpf-gjahr.
append it_bkpf1.
clear it_bkpf1.
endloop.
select belnr
gjahr
lifnr
xblnr
from RBKP
into table it_rbkp
for all entries in it_bkpf1
where belnr = it_bkpf1-belnr
This is just an example. Change the fields according to your requirement.
Regards
Abhii
Edited by: Abhii on Mar 9, 2011 9:08 AM -
Error in running Extract Definition Upload from Data File concurrent.
Hi all,
Am trying to upload the 834 Extract Layout from the data file by running the concurrent program, Extract Definition Upload from Data File.
After running this concurrent program am getting the Extract Layout definition with Record layout and Data elements within it.
But some record layouts has the changes at their repeating level in that.
Please suggest me how do i get the same repeating levels for the record layouts when i move the 834 benefit extract layout definition
from one instance to another instance.Hi,
We have exactly the same error in IBolt. This error happens sometime and we don't find the reason.
IBolt has been upgraded to Version 3.1 SP1 and a fix has been developed by the support. After installation, we've work hardly during 2 days for testing all the flows by the customer without having this error.
Ibolt works as a service and when this error occurs, the service stopped and must be restarted.
In our flows, we have put a delete of the observer.dll file just before the rest of the flow but it doesn't solve the problem.
Deleting the directory can be temporarly a solution but the error come back another day.
Each time the SBO client or DTW is started, the %temp%\SMS_OBJ_DLL directory is created...
When you just delete the observer.dll file and leave the rest of the directory like it is, the file is re-created when you start and log to SBO. I would say that this file is a copy of another file observer_800178.dll (800178 depending of the version of SBO yoi have). 800178 corresponds to SBO 2007 A PL 42.
Do you have more information since your post has been send ?
Thanks in advance for your help.
Best regards. -
Is there a way to open Excell file from the server and display in the UI and save it back on to the
Hello there,
Is there a way to open Excell file from the server and display in the UI and save it back on to the server? (like showing xell file as a datagrid - add rows, columns etc.)Hi Mike,
Welcome you to the forum.
You may try:
SELECT * FROM MyDBNameHere.dbo.OUSR T0
Thanks,
Gordon -
How can I extract certain pages from my document and save as another file?
How can I extract certain pages from my document and save as another file?
You would need Adobe Acrobat to do that, not Adobe Reader.
-
I have an ipod previously linked someone else's account. We used to share the library and they used to update my iPod for me. Now I have my own ID and laptop with iTunes. How to I extract my music from the iPod and add it to the library ? At present, I cannot do it because I am not authorised on the account the music was orginally purchased on - but I have my iPod still.
Is there anyway for me to extract the music files from my iPod and download them into my new iTunes library and using my own Apple ID?
Help! I paid for most of this stuff but they left with their computer and now I can't even update my iPod!
ThanksUnless you want to learn more than most of us want to know about being a good geek, you'll need a third-party software utility to do that. CopyTrans worked well for me when I moved songs from an old iPod to a new computer for a friend.
So 1.) set up your (PC?) computer with iTunes, 2.) get something like CopyTrans which imports the stuff from your iPod to iTunes on your computer, 3.) make sure all the files from your iPod got copied, and then 4.) set iTunes to be the Mother Ship, which will then write all your old and future stuff to your iPod.
Make sure you've 5.) tested a backup strategy for your iTunes library going forward, because Apple would prefer you'd buy everything again from them. iTunes no longer has a good, native backup utility. -
Hi,
I have : - IMAQ1394 2.0.1
- NI Vision 7.1
In VB, I can Snap/Grab Image from 1394 camera and display the Image in CWIMAQVIEWER :
Dim Image0 As New CWIMAQImage
imaq1394SnapCW(sid0,Image0)
CWIMAQViewer1.Attach Image0
Now,How can I do this in VC++6.0?
I tried:
C_CWIMAQImage m_imgViewer1;
m_imgViewer1 = m_CWIMAQVision1.CreateCWIMAQImage();
m_CWIMAQViewer1.Attach(m_imgViewer1);
imaq1394SnapCW(Sid,m_imgViewer1); <--there is no "imaq1394SnapCW "function in VC++,why?
Please help me!
Thank you!For people looking back at these old posts regarding
CWIMAQViewer - it was not made to be used in the C environments and is made
for VB.
Refer to the following locations for displaying images in C
environments:
Start»All Programs»National Instruments»Vision»Documentation
Start»All
Programs»National Instruments»Vision»Text Based Examples
Make
sure that you look at the examples and documentation that is in
reference to the C environments not the VB environments
Vince M
Applications Engineer
Maybe you are looking for
-
Changin Address Folder in Business Partner Master Data
Hi all Iam newbie to sap b1 I want to change the Address Folder in the Business Partner Master Data. What i have to do is when click the Address Folder I have to change the BILL To and SHIP To in Grid into Home To and Office To how can i do this can
-
Too many photos, how to organize?
I have a macbook pro and with two little boys, our hard drive has been filled up with photos. What is the best way to remove these photos from our computer but still keep them accessible and usable in iphoto? We do have a time capsule, which might
-
HP Photosmart c3180 Print Cartridge Cradle stuck on the left side
I have a HP Photosmart c3180. The ink cartridges were installed incorrectly. When I open the front to change the cartridges, the two cartridges do not move over to the right for me to remove and reinstall properly. All paper jams have been cleared
-
Site_File.js error please help
Hi all, I open DW8 and click on "site/manage sites/edit"to log in, as dreamweaver doesnt remember my ftp login (got a fix?), and dreamweaver returns the following error: "While excecuting receivingArguments in Site_File.htm, the following Javascript
-
Canon iR1025if is printing garbage with latest driver. What am I doing wrong?
I have an iMac with OS X 10.9 installed on release day (10/22). Ever since I upgraded I am not able to print "perfect" PDF files from Preview or Skim. Files generated using LaTeX and some special fonts print "garbage" or blanks with a Canon iR1025i