Regarding Date Function
Hi All,
Hi i want to implement the functionality as below, if i gave the Date as Input then i have to get the Respective Timezones is it possible, if yes then can u plz produce a sample snippet of it.
With Regards,
Justin
java.text.SimpleDateFormat to parse and format a date in any time zone.
Similar Messages
-
Regarding date function module
Hi abapers,
We have one requirement in selection screen validation.
From date is Day 1 of the next period(month).
To date is Day 1 of the next period*(month) + (next) 3 months.
which function module we can use.
how we can pass the selection screen of this date.
Thanks
Nani.Hi
Why we need the fun module
Just write the code as
select-options : s_date for sy-datum no display.
data: date like sy-datum, fdate like sy-datum, tdate is like sy-daum, mon(2),
mon1(2), mon2(2), year(4).
date = sy-datum.
year = date+0(4).
mon = date+4(2).
mon1 = mon + 1.
mon2 = mon + 3.
concatenate year mon1 '01' into fdate.
concatenate year mon2 '01' to tdate.
use the fdate and tdate and write the code
<b>Reward points for useful Answers</b>
Regards
Anji -
Re:regarding date function:urgent
Hi,
below is my code, i need to run monthly report, s_wadat is select-option variable, if i give 06/26/2003 i should get from month 05/01/2003 to 05/31/2003 data, my below code is working for current year only(2007 only), how to modify
data: last_month_last_day like S_WADAT.
last_month_last_day = S_WADAT .
last_month_last_day+6(2) = '01'.
last_month_last_day = last_month_last_day - 1.
*write:/ last_month_last_day.
data : date1 like S_WADAT.
date1 = last_month_last_day .
date1+6(2) = 01. "set the date to first of month
*write:/ date1.
SELECT LIKP~VBELN
LIKP~WADAT_IST
KNA1~NAME1
LIPS~MATNR
LIPS~CHARG
LIPS~LFIMG
LIPS~WERKS
VBKD~BSTKD
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM LIKP
JOIN LIPS ON LIKPVBELN = LIPSVBELN
JOIN VBKD ON LIPSVGBEL = VBKDVBELN
JOIN KNA1 ON KNA1KUNNR = LIKPKUNNR
WHERE LIPS~LFIMG GT 0 AND
LIKP~KUNAG IN S_KUNAG AND
LIKP~WADAT_IST between date1 and last_month_last_day
AND "S_WADAT-low and S_WADAT-high AND
LIKP~VBELN IN S_VBELN
ORDER BY LIKP~WADAT_IST
LIKP~VBELN.Hi,
The following code i used find last day of last month from sy-datum.
May this one help you
data: date1 like sy-datum.
parameters: p_date like sy-datum default sy-datum.
p_date+6(2) = 01.
date1 = p_date - 1.
aRs -
All,
Can I know the difference between the following two queries
select TO_CHAR(TRUNC(sysdate),'dd-mon-rr') from dual;
select TO_CHAR(TRUNC(sysdate),'dd-mon-yy') from dual;
However, both the query gives the same result as '03-nov-09'.
Regards
ND...of which century?
SQL> var dt varchar2(10)
SQL>
SQL> begin
2 :dt := '03-11-51';
3 end;
4 /
PL/SQL procedure successfully completed.
SQL>
SQL> select TO_CHAR(to_date (:dt, 'dd-mm-rr'),'dd-mon-yyyy') from dual;
TO_CHAR(TO_DATE(:DT,
03-nov-1951
SQL>
SQL> select TO_CHAR(to_date (:dt, 'dd-mm-yy'),'dd-mon-yyyy') from dual;
TO_CHAR(TO_DATE(:DT,
03-nov-2051Don't use a two digit year... -
Problem regarding data function 'SUMGT' (Overall Result) in BEx query desig
Hi,
I have created one query where I want to see the inventory data month wise. That's why at first I have placed 0calmonth (with variable) in column, secondly kept all the key figures which I want to see month wise under one structure, then placed the structure under 0calmonth in column. Now in that structure I have one key figure like 'total stock' and another global calculated key figure '% of total inventory' (='total stock' <b>%A</b> <b>SUMGT</b> 'total stock').
Now the problem is when ever I'm giving the value of month from 02.2006 to 05.2006, it is calculating the value of '% of total inventory' for every month with respect to the overall result of 'total stock' for month 05.2006.
But I want to calculate the value of '% of total inventory' for each month with respect to the overall result of 'total stock' for corresponding month.
Please suggest what I'll do now.
Thanks,
Arijit.Hi,
now i got whats the issue is.
Check aggregation properties of 'total stock'(RSD1>provide tech name of total stock>display-->aggragation tab)...
Exception aggregation would have been set to <b>'Last Value'</b> with some time char as aggregation ref characteristic..
That is the reason why SUMGT (or %SUMGT) is calculating on Last value of the 0calmonth interval.
i.e if you provide 02.2006 to 07.2006, %of total inventory for every month would be with respect to value of 07.2006...
Hope this helps...
Dont forget to reward if it helps!
thanks
Message was edited by: Murali -
Hi
I have problem regarding date function in the following statment and unable to sort out the real cause as yet, i am not finding any materail for using date function in sql where clause any one can help me why is it.
Sector Table
Sect_Id Varchar2(2),
Sect_name Varchar2(100),
Wef Date
:Adate--->Forms Field ,Datatype --->Char(11)
Trigger Post-Query <Block Level>
BEGIN
SELECT SECT_NAME INTO :SECTORNAME FROM SECTOR
WHERE SECT_ID=:SECTOR
AND TO_DATE(WEF,'MON-YYYY')=TO_DATE(:ADATE,'MON-YYYY');
EXCEPTION WHEN NO_DATA_FOUND THEN
MESSAGE ('DEFINE SECTOR SETUP...');
MESSAGE ('DEFINE SECTOR SETUP...');
END;
FRM-40735: POST-QUERY trigger raised unhandled exception ORA-01843.
Any help in this regard.
Thanks in advanceTO_DATE converts from a character string such as '2004-11-24' into an Oracle DATE. If you pass it an Oracle DATE, it first converts it to a character string using the default date format, then converts that back into a date. This is not only inefficient but unsafe, since the default date format can change, breaking your code.
TO_CHAR converts from various datatypes into a VARCHAR2 string. When converting from an Oracle DATE, it can provide the output in a variety of formats.
It's worth bookmarking the Oracle Documentation Library:
10g: download-west.oracle.com/docs/cd/B14117_01/nav/portal_3.htm
9i: otn.oracle.com/pls/db92/db92.docindex
TO_DATE(WEF,'DD-MON-YYYY')=TO_DATE(:ADATE,'YYYY-MM-DD');WEF is already a date. If you want to remove any time portion, use TRUNC(wef). -
hi gurus, i have some doubt regarding dates function.
if i enter any date of present month i wand the first date of next month.
for example if i enter any date in january from 01/01/2007 to 31/01/2007 i want
first date of february. ie 01/02/2007. plz help me.
regards
vamsi.Hi
use this coding
data : d1 type sy-datum,
d2 type sy-datum,
d3 type sy-datum,
d4(8),
m(2),
y(4).
d1 = sy-datum.
CALL FUNCTION 'BKK_GET_MONTH_LASTDAY'
EXPORTING
I_DATE = d1
IMPORTING
E_DATE = d2 .
write : d1.
skip 3.
m = d2+4(2).
y = d2+0(4).
concatenate y m '01' into d4 .
d3 = d4.
write : / d3.
write : / d2.
write / '***********2 month****************************'.
d3 = d2 + 1.
CALL FUNCTION 'BKK_GET_MONTH_LASTDAY'
EXPORTING
I_DATE = d3
IMPORTING
E_DATE = d2 .
write :/ d3,
/ d2.
write / '**************3 month ***************************'.
d3 = d2 + 1.
CALL FUNCTION 'BKK_GET_MONTH_LASTDAY'
EXPORTING
I_DATE = d3
IMPORTING
E_DATE = d2 .
write :/ d3,
/ d2. -
Data Federator Universe Date Functions
Hi,
I created a Data Federator Universe from target tables (Source Tables from: Sql Server 2005 and Oracle 10g). Now, I want to create a object in the universe: "Days between 2 dates"(coming from 2 different target tables). I don't see any other date functions other than CURDATE(). How to create my object?
Alternatively, Can I create a caliculated column in the existing target table? For Example, I want to create a new column "Days between 2 Dates" from 2 different tables by using a formula in Default mapping of the target table.
Thanks & Regards,
PeterHi Amit,
Thanks for your reply.
Ok. So, Universe on top of Data Federator has limited functionality.
And, other option you mentioned is on report level. I am creating an adhoc universe and I have few objects which will calculate days between 2 dates coming from 2 different tables.
But, how can I achieve this on Data Federator level. I have no function there to find Days Between 2 dates. I see lot of time and date functions but not the one I required. Also, I added a column in the target table and tried to apply the formula there in the default mapping area. But, I see only the selected target table. I need another date column from another table, which is not displayed in the default mapping area.
How can I achieve this?
Regards,
-Peter -
Date function doesn't work in Message Subject when scheduling batch
Hi,
When I was scheduling a batch and went to PDF attached E-Mail panel, in the Message Subject line I added a function <<Date(yyyy-MM-dd)>>,but when the email was sent, the date function in the subject didn't show the actual date, just showed the original function text <<Date(yyyy-MM-dd)>>, Is there anyone can help on this? Thanks in advance.Hi,
Can I know the Hyperion Version you referring ?
regards,
Harish. -
DATE function to get name of day for a Date given?
hi guys,
can anyone tell me what is the DATE function to get the name of day for a date given
(12/dec/2004)---returns SUNDAYHi peter
Your Query will return an error.
SQL> select to_char(to_date('12/dec/2004', 'mm/mon/yyyy'), 'DAY')from dual;
select to_char(to_date('12/dec/2004', 'mm/mon/yyyy'), 'DAY')from dual
ERROR at line 1:
ORA-01816: month may only be specified once.
month is specified twice.
select to_char(to_date('12/dec/2004', 'dd/mon/yyyy'), 'DAY')from dual;
Regards
Sasidhar.P -
Hi All,
I am trying to use date function in XSLT, I am using the below code, please correct me if i am wrong
<corecom:EffectiveDate>
<xsl:value-of select='xp20:format-dateTime(ns0:Segment-DTM/ns0:Element-373,"[YYYY][M01][D01]")'/>
</corecom:EffectiveDate>
Regards
FrancisHi Francis,
It doesn't seem to be anything wrong with the code itself, but what's the content of ns0:Segment-DTM/ns0:Element-373 ???
The xp20:format-dateTime function will work if the date on the first parameter is on ISO 8601 format...
http://www.w3.org/TR/NOTE-datetime
Examples
1994-11-05T08:15:30-05:00 corresponds to November 5, 1994, 8:15:30 am, US Eastern Standard Time.
1994-11-05T13:15:30Z corresponds to the same instant.
Cheers,
Vlad -
Need milli seconds part in XSLT Date Function current-dateTime()
Hi All,
I am calling date function, current-dateTime() in XSL. The output format is 2012-04-05T16:38:01-07:00 (Without milli seconds)
How to get the milli seconds part...?
Regards,
SudheerHi Arik....
At last i got it. :)
Followed the below steps.
Step1:
Created a String variable "currentDateTimeValue" in BPEL.
Step2:
I have used the below code in JavaEmbedding in BPEL.
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat();
//Date Pattern looks lil weird. But some Web service accepts only this format.
sdf.applyPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'-00:00'");//2012-04-14T16:24:00.578-00:00
String formattedDate = sdf.format(new java.util.Date());
addAuditTrailEntry("Formatted datetime string is: " + formattedDate);
setVariableData("currentDateTimeValue", formattedDate);
Step3:
Created a Simple XSD with an element "DateElement" of String type.
Step4:
Assigned "currentDateTimeValue" value to "DateElement" element, in Assign activity.
Step5:
Now added this DateElement in Transformation activity, as a second source variable. Mapped this data to the required target element in my XSL.
uh-huh I got the output...
Thanks a ton ARIK :D u r really helpful...
Regards,
Sudheer -
Syntax for NOW() in date function
Hi all
What is the syntax for NOW() in Date function? Can anybody help me..
Thanks&Regards
HemaHere's how I used it.
In VC select an expression box. When creating it, ensure you have the data type DATE selected and provide a field name. If you don't select a date data type, it will not work (the default is text).
In the Data source field section, under the Expression field, select Formula, Under Date Functions select NOW(). You can also format the date
If you want to select yesterdays date, use the following formula:
DADD(NOW(),-1,'d') -
Raw to date function in oracle
Hi..
I would like to know the details and usage of Raw to date function in oracle database.Could some one let me know the function details?Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> set serveroutput on
SQL> DECLARE
2 rv RAW(32) := '786B060818023A';
3 dt DATE := NULL;
4 BEGIN
5 dbms_stats.convert_raw_value(rv, dt);
6 dbms_output.put_line(TO_CHAR(dt, 'DD-MON-YYYY'));
7 END;
8 /
08-JUN-2007
PL/SQL procedure successfully completed.
SQL>Regards,
Jo
PS: This is not my own example. I don't recollect the link I got this example from. Will post the link if I come across it again. I think its www.psoug.org (not sure) -
Pl/sql Year to Date Function
Dear All!
Its very urgent task for me. i'm working on Oracle discoverer. i'm creating Project Year to Date report. i need one year to date function. i've only period name. The scnerio is this, in our company financial year is starting from (April to March i.e 01-April-2011 to 31-mar-2012). i need to apply YTD function on Period name. when any user select any period it will show from 01-apr-2011 to select mont. for example if user select Feb-12 then it must be from 01-apr-2011 to 29-feb-2012.
Please this is urgent.. give Query for function. please
Regards
Ahmed....Hello,
Can you put an example on apex.oracle.com and provide a link, it will be much easier to help you out?
Regards,
Carl
blog : http://carlback.blogspot.com/
apex examples : http://apex.oracle.com/pls/otn/f?p=11933:5
Maybe you are looking for
-
Hi, This is urgent. I have 5 tables to take from a source to a target schema. Each row of each table needs to be augmented with a warehouse_id and a date. I created a table called warehouse_tag which has two columns of warehouse_id and warehouse_date
-
How to move iPhoto Project to Photoshop
Is it possible to move a Project (album) created in iPhoto to photoshop for additional processing ?? if yes , please explain How.
-
How to create a master form with selectable/insertable subforms?
I have created a general information form for business services we offer, at the bottom of the form I have made several check boxes so that the person who fills out the form with all of the general information can then select the service they want to
-
First 2 Higher Number and Last 2 Lower Number
Hi Experts I have a table with the name T there are some numeric values i want to select First 2(60, 50) Higher numbers and Last 2 (10 and 20) Lower numbers with query. I'm using Oracle 10g R2 C1 10 20 30 40 50 60 Please
-
How to keep my place in a list when on shuffle? [iOS]
I don't really know a way to succintly state my question so I may ramble a bit. Basically, I have a 400+ song, 24+ hour playlist I made for a week-long roadtrip, thinking that since we had less than 24 hours of driving to do we wouldn't hear any song