How to calculate first date of month from a given date in IDT BusinessObjects
Hello Experts,
I have a date field in IDT Universe which shows date in this format: Dec 13,2014 12.00.00 PM. Now I want to extract first day and last day of month from this date value. For example: here I want to see Dec 01,2014 12:00:00 PM and Dec 31, 2014 12:00:00 PM in First day of month and Last day of month columns. Also, if database date value is Nov 17, 2014 12:00:00 PM then in first day of month column, it should show Nov 01, 2014 12:00:00 PM and in last day of month it should show Nov 30, 2014 12:00:00 PM.
I got some google help but 'Date' function is not supported by IDT tool in BusinessObjects.
Please help.
Thanks in advance.
Hi
Try to use the DB Functions to find out the First and last day. Please find out the below screenshot.
If DB is BW, you can calculate the First and last day @ BW level use same object in BO directly.
SQL DB:
http://docs.oracle.com/html/A95915_01/sqfunc.htm#i1006893
Oracle DB:
http://msdn.microsoft.com/en-US/library/ms189794(v=sql.90).aspx
Similar Messages
-
I have a situation, where i need to write expression Period to date(PTD). i want to know how to get the period date. i want you to help in writing Period date or else is there any function to get period date for a given date(the date is given
from the parameter dynamically) in MDX for SSRS report
ramHi ram,
Per my understanding that you want to get the period date based on the month selected and the given date, right?
Could you please provide details information below to help us better understanding your requirements, thus we will be more effective to provide an solution:
What is the format of the period date you want to get, is this date in the DB and you want to filter it based on the month and the given Date?
Did the month and given date are two parameters in the report? if possible, could you please provide some sample data in the DB and also the snapshot of the report structure
I assume you want to get the period date(mm/dd/yyy) between the select month(e.g:Feb) and the given date (10/1/2014) and you should get the date between(02/01/2014-10/1/2014).
If so,and you also have two parameter "Month","EndDate"(EndDate is the given date), please reference to details information below:
You can create an new parameter "BeginDate" (Date/Time) which is the begin date of the period, you can use the expression to get the value based on the value of the month and the year value from the given date,finally hide this parameter:
Specify the available value:
Label:=Parameters!Month.Value &"/01/"& DatePart("yyyy",Parameters!EndDate.Value)
Value:=CDate(=Parameters!Month.Value &"/01/"& DatePart("yyyy",Parameters!EndDate.Value))
Specify the default Value:
Value:=CDate(=Parameters!Month.Value &"/01/"& DatePart("yyyy",Parameters!EndDate.Value))
Add filter to the dataset as below:
Preview you will get all the date in the given Period:
If you still have any problem, please feel free to ask.
Regards
Vicky Liu -
Function Module to Return MM/DD/YYYY after 6 Months from today's Date
Hi,
I need to find out the Month/Date/Year, after 6 months from the given Date. Can any one please suggest me a suitable Function Module to get the MM/DD/YYYY after 6 months from current date.
Appreciate your help!
Thanks,
Kannan.You can also use :-
RE_ADD_MONTH_TO_DATE
Kindly reward in case useful.
Regards,
Darshan Mulmule -
Number of Days from a given Date
How can one calculate the number of days in a month from a given date?
Ex: If I pass 07/12/2008 it should return 31But your example doesn't meet the OP request. The OP wanted the number of days in a month where the month is determined by a specified date (paraprhased).
DimaCit gave two credible solutions that met that requirement. Yours just counts the number of days between two apparently arbitrary dates. -
How to get the first day in the month from a domain date ?
Hi,
I like to know how to get the first day in the month from a domain date?
Thanks
StephenHi Gokul...
Instead of using the funtion module you can just write the 3 statements of code to get the first day of the week.
Its similar to the above one but instead of writing case statement you can achive the following.
data : w_res type i,
w_data type d,
w_res = w_date mod 7.
w_date = w_date - w_res.
write w_date.
This works.
Regards,
Siddarth -
How do I display today's date and a date 1 month from today in livecycle designer
Hello,
Does anyone know how to display a future dates in 3 date fields that would be 1 month; 2 months and 3 months from today?
I am making a sales contract form and in a date field is today's date (which can be altered if the user needs to change it). The javascript I have is:
if
(this.rawValue == null){
var
msNow = (new Date()).getTime();
var
d1 = new Date(msNow); this.rawValue
= util.printd("mmm/dd/yyyy", d1);}
else
{ this.rawValue
= rawValue;
Then in the next date field i need to display the date 1 month from today
The third date field 2 months from today
the fourth date filed 3 months from today.
Any suggestions would be greatly appreciated.Hi Peter,
If you need to be more exact than adding 30 days then you can use the following code;
function
addMonth(date){
var year = date.getFullYear();
var month = date.getMonth();
var day = date.getDate(); month= (month % 12) + 1; year
+= parseInt(month / 12);
var days = daysInMonth(month, year);
if (day > days) {
day= days; }
return new Date(year, month, day);}
function daysInMonth(iMonth, iYear){
return 32 - new Date(iYear, iMonth, 32).getDate();}
You need to pass in a Date object to addMonth so (assuming DateTimeField1 is your date field);
NextMonth.rawValue= util.printd("mmm/dd/yyyy", addMonth(
= util.printd("mmm/dd/yyyy", addMonth(
Date.parse(DateTimeField1.formattedValue));
Bruce -
How to display first row value returened from a query as checked as default in a report
How to display first row value returned from a query as checked as default in a report
Example
Parameter 1
Paramerter2
ABD
x(checked)
Test
DEF
JMG
MudassarHi Mudassar,
The issue is caused by the order in which the parameters appear in the report data tab can be difference between our report execution and it failing. In other words, “Parameter2” is execution before parameter “A” due to this issue. We can adjust the parameter’s
order to solve the issue.
If “Parameter2” is parameter “A”, we cannot use that expression. Because fields cannot be used in report parameter expression, if we want to display the first value returned from a query as default value, we have to fill the “Specify values” text box with
the specific value in Default Values dialog box.
Regards,
Alisa Tang
Alisa Tang
TechNet Community Support -
Oracle - How do i find last 18 months from sysdate
How do i find last 18 months from sysdate as Month Date and year (i.e MMDDYYY)
SELECT to_char(sysdate,'MMDDYYYY') "Today", TO_CHAR(ADD_MONTHS(sysdate,-18), 'MMDDYYYY') "-18th Month" from dual;
Today -18th Mo
10212008 04212007 -
How to delete the sales org information from BP Master Data in SAP CRM 5.0
Hi Guruu2019s
How to delete the sales org information from BP Master Data in SAP CRM 5.0
Thanks...
Mahesh PasupunuriHello
There is a report attached to [SAP Note 725857|https://service.sap.com/sap/support/notes/725857] that performs the deletion.
Regards
Joaquin -
Defaulting date 3 months from present date
HI!
In my selection screen in my report I need to default a
selection option to a future date which is 3 months from the
present date. Can anyone tell me whats the way to do this so
that I can add 3 montsh from the present date and default it in my selection screen.
example : if we consider todays date then we need to
default that date to 9th of september 2008 so it keeps of
changing everyday as dates proceed.
ThanksCheck the below program :
REPORT ZTEST78 .
data v_fdate type d.
CALL FUNCTION 'HR_PSD_DATES_ADD_MONTHS'
EXPORTING
V_DATE = sy-datum
V_MONTHS = 3
IMPORTING
E_DATE = v_fdate
EXCEPTIONS
NOT_POSITIVE = 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.
write:/ v_fdate.
do not add 90 days ,some months may have 31 or 29 or 28,you will not get exact calculation,so use FM 'HR_PSD_DATES_ADD_MONTHS'
Thanks
Seshu
Thanks
Seshu -
How to calculate the number of months....
HI all
can any body give the FM name which calculates the number of months between any two dates that are inputted
thanks in advanceTry this in ur source code of FM.....include the import and Export...as given
""Local interface:
*" IMPORTING
*" REFERENCE(BEGDA) LIKE PA0001-BEGDA
*" REFERENCE(ENDDA) LIKE PA0001-ENDDA
*" EXPORTING
*" REFERENCE(DIFF_MONTHS) TYPE I
*" EXCEPTIONS
*" ENDDA_GRTR
DATA : SMONTH TYPE I,
EMONTH TYPE I,
SDATE TYPE I,
EDATE TYPE I,
SYEAR TYPE I,
EYEAR TYPE I,
MONTHSTOBEADDED TYPE I,
YRDIFF TYPE I,
DIFF TYPE I.
Calculating the months to be added
SMONTH = BEGDA+4(2).
EMONTH = ENDDA+4(2).
Finding the difference in years
SYEAR = BEGDA+0(4).
EYEAR = ENDDA+0(4).
IF SYEAR <> EYEAR .
SYEAR = SYEAR + 1.
DIFF = ( 12 - SMONTH ) + 1.
YRDIFF = EYEAR - SYEAR.
IF YRDIFF > 0 .
DIFF = DIFF + ( YRDIFF * 12 ).
ENDIF.
DIFF = DIFF + EMONTH.
ELSE.
DIFF = ( EMONTH - SMONTH ) + 1.
ENDIF.
DIFF_MONTHS = DIFF.
ENDFUNCTION. -
Nearest Monday from a given date - how do I do this?
Hello:
We have a requirement to find the nearest Monday from a given date.
Can anyone help me with this query?
Thanks!This?
1 with t as (select trunc(sysdate)-3 + level dt
2 from dual connect by level <=20
3 )
4 select dt,round(dt,'iw') nearest_monday
5* from t
SQL>/
DT NEAREST_MONDAY
Sunday 19/09/2010 Monday 20/09/2010
Monday 20/09/2010 Monday 20/09/2010
Tuesday 21/09/2010 Monday 20/09/2010
Wednesday 22/09/2010 Monday 20/09/2010
Thursday 23/09/2010 Monday 20/09/2010
Friday 24/09/2010 Monday 27/09/2010
Saturday 25/09/2010 Monday 27/09/2010
Sunday 26/09/2010 Monday 27/09/2010
Monday 27/09/2010 Monday 27/09/2010
Tuesday 28/09/2010 Monday 27/09/2010
Wednesday 29/09/2010 Monday 27/09/2010
Thursday 30/09/2010 Monday 27/09/2010
Friday 01/10/2010 Monday 04/10/2010
Saturday 02/10/2010 Monday 04/10/2010
Sunday 03/10/2010 Monday 04/10/2010
Monday 04/10/2010 Monday 04/10/2010
Tuesday 05/10/2010 Monday 04/10/2010
Wednesday 06/10/2010 Monday 04/10/2010
Thursday 07/10/2010 Monday 04/10/2010
Friday 08/10/2010 Monday 11/10/2010 -
Find 3rd friday of the month for a given date
how to find out 3rd friday of the month for a given date? I can always pass the first day of the month as input
eg, input date is 01-JAN-09. need to get the 3rd friday 16-JAN-09 (Jan has 5 fridays 02, 09, 16,23,30)
input date : 01-feb-09, need to get 20-feb-09
Edited by: user520824 on Apr 1, 2009 12:30 PMNLS independent solution:
SELECT DT,
TO_CHAR(DT,'FMDay') day,
CASE
WHEN TRUNC(TRUNC(DT,'MM') + 7,'IW') - 3 < TRUNC(DT,'MM') THEN TRUNC(TRUNC(DT,'MM') + 7,'IW') + 18
ELSE TRUNC(TRUNC(DT,'MM') + 7,'IW') + 11
END THIRD_FRIDAY_OF_THE_MONTH
FROM (
SELECT TO_DATE(LEVEL || '/2009','MM/YYYY') DT
FROM DUAL
CONNECT BY LEVEL < 13
DT DAY THIRD_FRI
01-JAN-09 Thursday 16-JAN-09
01-FEB-09 Sunday 20-FEB-09
01-MAR-09 Sunday 20-MAR-09
01-APR-09 Wednesday 17-APR-09
01-MAY-09 Friday 15-MAY-09
01-JUN-09 Monday 19-JUN-09
01-JUL-09 Wednesday 17-JUL-09
01-AUG-09 Saturday 21-AUG-09
01-SEP-09 Tuesday 18-SEP-09
01-OCT-09 Thursday 16-OCT-09
01-NOV-09 Sunday 20-NOV-09
DT DAY THIRD_FRI
01-DEC-09 Tuesday 18-DEC-09
12 rows selected.
SQL> SY. -
Calculate all days in month from schedule line delivery date for 12 mths
Hi experts,
I am trying to solve a problem and would appreciate any help! Im on BI7.
The user will input a date for the schedule line delivery date via a variable.
From this date I need to go forward 12 months exactly and display a key figure (outstanding value) by months but the first and last months must only use the days in that month i.e not the whole month if not selected by the user.
I.e if the user types in 13.05.2008
The display need to show (columns)
May 08 (13th to end of May 2008)
June 08 (All)
July 08 (All)
August 08 (All)
Sept 08 (All)
Oct 08 (All)
Nov 08 (All)
Dec 08 (All)
Jan 09 (All)
Feb 09 (All)
Mar 09 (All)
April 09 (All)
May 09 (1st to 12)
So I neen to restrict the key figure (Outstanding Value) by Schedule Line Delivery Date and display as above on a 12 month forecast basis from the day (sch line delivery daye) entered as a variable by the user.
I also need the first month to only show the dates in the month remaining including the date entered as a variable. The last month must go up to the day before exactly a year in front.
I have created the 12 months as a structure and can include the key figure and the schedule line delivery date. The schedule line delivery date for each period needs to be restricted. How can I do this to achieve the above?
Thanks in advance. Will assign good points for a speedy solution.
Best
Steve.Hi,
Check "OVLY" and "OVLZ" and If the sceduling is active for he shipping point /sales document type. Check "OVXD" and see If the Loading time/ Pick/pack time is determined from it. If they are getting determined from shipping point check the shipping point calender in "SCAL" .If it has saturday and sunday as holidays ,then you may have to change them. And check If the customer has goods recieving hours assigned to him (In customer master unloading point). If he has only 5 working days and If he accepts only goods at 8 am in the morining then system would propose like this.Kindly please let me know If you need any more Information on this.
Regards
Ram Pedarla -
How to calculate first date and end date of this year in Query
Hi Expert
I want to calculate following dates with inputted date in query.
I have no knowledge on ABAP and I just can create a query with simple logic.
Could you teach me how to calculate following date?
(If inputted date is April 12 2009)
- First date of this year (Ex January 1 2009)
- End date of this year (Ex December 31 2009)
- First date of last year (Ex January 1 2008)
- End date of last year (Ex December 31 2008)
- First date of this month (Ex April 1 2009)
Thank you!
TakeHR_JP_MONTH_BEGIN_END_DATE use this FM to get the begin and end date of the Date you are passing. eg when u give input as 04/12/2009, it will return
04/01/2009 as begin date
04/30/2009 as end date
pass the Year in this FM HR_E_GET_FISC_YEAR_DATES, you will get the Fiscal year Begin and End Dates
Abh
Maybe you are looking for
-
Error while deploying models in VC
Hi Experts, I am encountering the following error while deploying any model on Portal. The model compiles without any errors but while deployment it gives the below error: Error in compiling Flex application: Error: Element type "vc:VCFormLabel" must
-
I'm trying to use the DBMS_XMLSave package and the stored procedure won't compile saying it doesn't know what DBMS_XMLSave.ctxType is. Does the express edition not support this package?
-
Hi When I download and play video podcast I get only the audio. No video is appearing. This is the case in front row as well. Am I missing something. Please help C. Badrakumar
-
Quality of photos on burned DVD no where near original files
The quality of the photos in a slideshow I burned to DVD using iDVD 6.0 are NO WHERE near the quality of the un-edited original files. It's so bad I wouldn't even give the DVD to someone. What gives? I chose "High Quality" encoding in iDVD. I was exp
-
The TO box used to auto fill when I started typing if an address was in my Contact list. The + at the end of the area for an email address says I have no Contacts With Firefox, Yahoo Mail works normally except for contacts, when I click "Contacts" I