Minus age from current date
Hi experts,
I have an Age field coming from sender system.
I need to minus the age from current date and provide the output in form of date towards the target system.
PLS help me out..
Hi
have a look at these
(How do I calculate the difference between two dates?)
http://joda-time.sourceforge.net/faq.html
Calculating the Difference Between Two Datetime Stamps
http://www.xmission.com/~goodhill/dates/deltaDates.html
Get difference in days
http://javaalmanac.com/egs/java.util/CompDates.html
Thanks
Gaurav
Similar Messages
-
Last 6 months of data from current date
Hi Experts,
I have a requirement in WebI to display last 6 months of data based on current date.Actually I have a column called "Employee Contract Start date" in my report.Suppose the end user executes the report today,then he should be able to see the Employee's data whose contract started today and in the last 6months from current date.
Also I have dimension object name "Employee Contract Start Date".
Please be noted that I am getting the data from Bex Query and I am working on BO 4.1 version.
I have Objects "Calender day" , "Cal.year/Month" , "Calender month" , "Employee Contract Start Date" in the BEx Query.
Could anyone please propose me, what are the ways to meet this requirement?Hi Cris,
We can get the 6 Months date in webi.
Check the below blog , will help you.
http://scn.sap.com/community/businessobjects-web-intelligence/blog/2014/01/21/time-variablesdimensions
Regards,
Javed -
Extract data on report between last 30 days from current date.
Hi Experts,
Ealrier i had provided user promt to select the date range, now i need to schedule the report for this i have to set the date between last 30 days from current date.
How can i add this in formaula on record selection.
before:
{pm_process.pm_creation_date} in {@Start Date to UTC} to {@End Date to UTC}
I tried:
{pm_process.pm_creation_date} in CurrentDate() - 30 to CurrentDate()
But this is diplaying me only data of 30th date from current date.
Please advice.Hi Brian,
Thank you!
1. I have not created any function for {pm_process.pm_creation_date} in [CurrentDate() - 30 to CurrentDate()] i am just adding this on Record Selection and its not helping.
2. {pm_process.pm_creation_date} in Last30Days; this is throwing below error.
please advice what to be done? -
2 month old date from current date in red color only
Hi all,
How can I Highlight 2 month old date from current date in red color only at report level with using Alertr.
Example:-
Date
3/27/2014
4/3/2014
3/5/2014
4/1/2014
3/31/2014
5/24/2013
2/10/2014
4/11/2014
12/11/2013
9/25/2013
1/30/2014
2/18/2014
2/24/2014
1/6/2014
3/3/2014
Thanks
SamHello Sam,
are you using Universe for your report..if Yes..pls try below option.
Create two objects in the universe
Object1 syntax: current date() (Note:this object you can create at webi level)
Object 2 syntax:addmonths(sysdate;-2)
Now create a alert in webi report by using below conditions
Day is less than Object1
and
Day is greater than Object2
Please try this and let me know if any issues.
Regards,
Naveen D -
How to get name of the month from current date.
Hi,
How to get the name of the month from current date.
Thanks,
SenthilSethil,
Use your date(let us say Date1) instead of sy-datum.
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
LANGUAGE = SY-LANGU
IMPORTING
RETURN_CODE =
TABLES
MONTH_NAMES = itab_month
EXCEPTIONS
MONTH_NAMES_NOT_FOUND = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE itab_month
WITH KEY MNR = date1+4(2).
itab_month-LTX will contain the value you are looking for
Good luck
Raghava -
Subtracting months from current date
how to subtract months from current date in mysql
You are in an Oracle forum, so the Oracle answer is: use add_months(sysdate,-2) to subtract two months from the current date.
Regards,
Rob. -
Get last august month from current date
Hi,
I need to get last august month from current date.
e.g if current date is 1-OCT-2013 need to get last August date i.e.1-AUG-2013
e.g. if current date is 1-MAY-2013 need to get last August date i.e.1-AUG-2012Something like this?
SQL> WITH table_x AS(
2 SELECT SYSDATE dt from dual UNION ALL
3 SELECT TO_DATE('20-05-2013','dd-mm-yyyy') from dual
4 )
5 --
6 ---
7 --
8 SELECT dt,
9 CASE
10 WHEN (dt >= Add_Months(TRUNC(dt,'YEAR'),7)) THEN
11 Add_Months(TRUNC(dt,'YEAR'),7)
12 WHEN (dt < Add_Months(TRUNC(dt,'YEAR'),7)) THEN
13 Add_Months(TRUNC(dt,'YEAR'),7) - 365
14 END cs
15 FROM table_x;
DT CS
24-OCT-13 01-AUG-13
20-MAY-13 01-AUG-12 -
How to get previous 2 months from current date in a dropdown?
Hello Experts ,
In the application which I am developing, there is a requirement wherein , I want to Populate current month and previous two month in a drop down depending upon today's date. please help.
Thanks & Regards,
Pratbha ShuklaThe internal format for dates is yyyymmdd. Therefore you can just grab the month value from the date:
data lv_month type FCMNR.
lv_month = lv_date+4(2).
Just subtract from the month to get the two previous.
data lv_previous1 type FCMNR.
data lv_previous2 type FCMNR.
if lv_month = 1.
lv_previous1 = '12'.
else.
lv_previous1 - lv_month - 1.
endif.
if lv_previous1 = 1.
lv_previous2 = '12'.
else.
lv_previous2 - lv_previous1 - 1.
endif.
Then do your lookup for the month name by reading the table returned from function module MONTH_NAMES_GET. -
FM to calculate fiscalyear period from current date
Experts,
Is there any FM which outputs fiscal year period in the format mmm/yyyy when current date is given as input. I need this coz i want to automatically calculate current fiscalyear period for a query variable..
Thanks,
DVHi Edwin,
When i expand the Fiscalyear Period infoobject in the query design in globval view, i donty see 0F_FPER. Does that mean it has to activated from Business Content? Or can i create a variable like that one??
DV -
Sum from current date to the last date of sales
Hi
It's been a while since I used MDX last time.
I have a simple question (probably). I need a measure which sums up from the current date to the last sale date.
It's like a reversal of Year To date. And I need to do it date level.
Let's say is the sales goes like
1/May/2000 $1000
2/May/2000 $1000
3/May/2000 $1000
4/May/2000 $1000
5/May/2000 $1000
I need to create a measure which displays sum of current sales and last sales
1/May/2000 $5000
2/May/2000 $4000
3/May/2000 $3000
4/May/2000 $2000
5/May/2000 $1000
I have a date hierarchy and hope it can be rolled up.
And I tried like something like ( suggested in another posting)
[Date].[Calendar].CurrentMember:NULL}
But this does not work for me.
The actual MDx I wrote is
With member MEASURES.ActiveLicences as
sum (
{[License Expiry Date].[FinancialYear].[YY-MMM].CurrentMember: null},
[Measures].[No of Students]
select {
MEASURES.ActiveLicences,
[Measures].[No of Students] } on columns,
[License Expiry Date].[FinancialYear].[YY-MMM].members on rows
from [Sales];
Can anyone help me with this please?
Kind regards
Mark KimHi SQLMa ,
I was trying a similar code, using a hierarchy expression instead of a member expression for the CurrentMember functionality . Here is an Adventure Works example :
With member MEASURES.ActiveLicences as
sum ( {[Delivery Date].[Fiscal].CurrentMember: null}
, [Measures].[Internet Sales Amount])
select {MEASURES.ActiveLicences,[Measures].[Internet Sales Amount]} on columns
, [Delivery Date].[Fiscal].[Month].members on rows
from [Adventure Works]
Hope it helps :)
Regards, David . -
Calculate age from a date on numbers
I am trying to calculate age from a given date in the application numbers. The dates are all in the same column but i need to convert them to ages. I have not been able to find any formulas!
ThanksHi,
DATEDIF is a good place to start:
This example is from the Function help in Numbers, I claim no credit for it. -
Query to deduct the time from current date and time
I want to get the query to deduct time(180 mins) from the current date and time.
Regards
PavanSQL> select to_char(sysdate,'dd.mm.yyyy hh24:mi:ss') curr,
2 to_char(sysdate - interval '180' minute,'dd.mm.yyyy hh24:mi:ss') past from dual
3 /
CURR PAST
24.08.2007 16:18:37 24.08.2007 13:18:37
SQL> -
Current Date in Debugger different from Current Date in Web-Determinations
Just today....
The current date in my laptop is 7/4/2012;
When I invoke build and restart debugger without screens, I am showing the current date at 7/4/2012
When I invoke build and restart debugger with screens, the current date is showing as 7/5/2012
Does anyone have any thoughts about this?
Thanks,
AllanWe are using OPM 10.4
The project region is US (English)
It's running on a laptop where the time zone is Pacific Time (US&Canada) - (UTC-8:00)
For this moment (0740) local, the current date is showing as 7/5 in both debugger with and without screens.
I will monitor hourly to see if it flips over to tomorrow's date.
As an aside, I note, on project start-up, it takes 3-4 efforts to deploy to debugger with screens. It seems to time out (error message says "Tomcat embedded web server failed to start after 30 seconds") for the first two or three tries, and then finally loads. I don't recall this experience in prior versions. Any thoughts on that? is there something I should set?
thanks, will update regularly to see if the date cross-over seems to occur at GMT 1200am. -
Calculating Previous Month(s) From Current Date
Greeting JavaScripting Gurus!
I would like to ask for some assistance on Date Calculation.
Here is my current scenario:
The user inputs a date mm/dd/yyyy ("DateField")
The powers that be over here are asking for the "DateField" to then calculate these items:
"DateField" minus(-) 12 months = mm/yyyy ("12MonthsAgoDateField")
"DateField" minus(-) 18months = mm/yyyy ("18MonthsAgoDateField")
"DateField" minus(-) 36 months = mm/yyyy ("36MonthsAgoDateField")
and so on...
I've read some of the Date Calculation posts, but could no seem to find anything that fit this scenario.
I freely confess my javascripting ability is very minor.
I would greatly appreciate any help in scripting this.
Thank you!Unfortunately the numbers of days in a month or year are not the same for all months or years, so the get and set date methods might not work. Fortunately there are the getMonth() and setFullYear() methods for getting or setting the month or year for a given date.
For the "On Blur" action for the "DateField" you can use:
function GetField(cName) {
// get a field object with error catching;
var oField = this.getField(cName);
if(oField == null) app.alert("Error accessing field named: " + cName, 0, 0);
return oField;
} // end GetField function;
function AddMonths(oDate, nMonths) {
// add nMonths to oDate object;
oDate.setMonth(oDate.getMonth() + nMonths);
return oDate; // return adjusted date object;
} // end AddMonths;
function Scand(cFormat, cDate) {
var oDate = util.scand(cDateFormat, event.value);
if(oDate == null) app.alert("Error converting " + oDate.valueAsString + " with format: " + cDateFormat, 0, 0);
return oDate;
} // end Scand functon;
var cDateFormat = "mm/dd/yyyy"; // format for date strings;
// event value is the start date string;
// 12 months ago;
var o12MonthsAgo = GetField("12MothsAgoDateField")
var oDate = Scand(cDateFormat, event.value);
oDate = AddMonths(oDate, -12) // subtract 12 months;
o12MonthsAgo.value = util.printd(cDateFormat,oDate);
// 18 months ago;
var o18MonthsAgo = GetField("18MothsAgoDateField")
oDate = Scand(cDateFormat, event.value);
oDate = AddMonths(oDate, -18) // subtract 18 months;
o18MonthsAgo.value = util.printd(cDateFormat, oDate);
// 36 months ago;
var o36MonthsAgo = GetField("36MothsAgoDateField")
oDate = Scand(cDateFormat, event.value);
oDate = AddMonths(oDate, -36); // subtract 36 months;
o36MonthsAgo.value = util.printd(cDateFormat, oDate);
// and so on;
Since getting a field object, converting a date string to a date object and adjusting the date object using the getMonth and setMonth methods are repeated several times I have used functions so the repeated code could be reused. -
BI Routnie in DTP to calculate current week from current date
Hello Team
I want to write routinue to calculate current week based on date
For eg, this week is
201410, so the routine will get 201410 based on today’s date 4 Mar 2014.
Can any1 please help
Regards,
AnkitI had written following code its giving error like
E:Field "/BI0/9AVERSION" is unknown. It is neither in one of the
specified tables nor defined by a "DATA" statement. "DATA" statement.
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = '/BI0/9AVERSION '.
l_idx = sy-tabix.
Data: Date Like scal-date.
Data: week like scal-week.
call function 'DATE_GET_WEEK'
exporting
date = sy-datum
importing
week = SOURCE_FIELDS-/BI0/9AVERSION
exceptions
date_invalid = 1
others = 2.
* Return code <> 0 means skip whole data package !!!
returncode = 0.
Maybe you are looking for
-
External hard drive isn't shown on desktop anymore
Hello! I've got a problem with my external hard drive... I'm using a *G4 iMac* and an *external hard drive* by "iomega". Today my computer crashed down and I had to relaunch it without having a chance to eject the external hard drive before. When I g
-
itunes error writing to file: C\Config.Msi\165996.rbf verify that you have access to that directory That's the error I get when trying to uninstall or reinstall my itunes. The application no longer works and I just purchased a new Ipod touch 4th gen
-
Hi All, Just I have deployed a web application in my WebLogic through console successfully. My application also working properly, but when I am accessing my console, I am getting below error. <Error> <Console> <BEA-240003> <Console encountered the fo
-
Problem with Hypelinklistener and updater
Hi there, I was using a Hyperlinklistener and was working very well till today that I made him to some other opperations too and now it's not loading the other pages. My code is here and I get the exception message when I click in a link public void
-
Problem with CMP bean and MySQL: please help me!!!
Hi, I am using J2EE Sun server 1.3 and Mysql 4.0 database with its MySQL Connector/J 3.0. The driver connection to the database is fine since "Generate Default SQL" in deploytool gives "SQL generation complete". However, I can't have a simple row wit