I am using Business Objects Edge and on a report I want to create has a front cover and I was hoping to add the month and year of the previous month in the following format:
September 2015
Any help would be appreciated.
Thanks
B
I dont have access to BO Edge, I mocked up the following in BOE WebI XI3.1:
=FormatDate(RelativeDate(CurrentDate();(DaysBetween(CurrentDate(); ToDate("01/" + FormatDate(CurrentDate();"MM/yyyy"); "dd/MM/yyyy"))-1)); "Mmmm yyyy")
This gives you the days between now and the start of the month, which today will give you -26 and because we want last month then you would minus another day. Then using I formatted the date so that it appears as the Month Year.
Related
Do you know any Keyword or any Logic in Robot Framework to get the last day of the Each month.
Actually, I am working on a Calendar and in that Whenever it will be last day of the month I need to click on Next Button.
Thanks in Advance!
Python's calendar library can provide this information.
In your Robot test script you can call
calendar.monthrange(year, date)
which will return a list of two numbers, the 0th element is the weekday of the first day of the month, and the 1st element is the days in the month.
In example
${year}= Set Variable 2022
${month}= Set Variable 2
${tupleContainingEndDate}= Evaluate calendar.monthrange(${year}, ${month})
${numberOfDays}= Set Variable ${tupleContainingEndDate}[1]
Log ${numberOfDays}
${numberOfDays} is:
28
I am working with a data set where the Period is given as
2001.01,2001.02,2001.03......When I am trying to convert it using yearmon() it shows only Jan and Feb this two month.For
example for 2001.05 it shows Jan 2001. But it should be May 2001. I think I need to convert the Period in 2001-01 format
first before using yearmon(). Can anyone plz tell me how can I do it?
I'm trying to create a calculated field for the age of an asset (say, an article or youtube video) in Data Studio. So basically it's the current date less the creation date, hopefully leaving me with the number of days since the item has been created.
Google's sample for this is:
DATE_DIFF(TODATE(end_time, 'NANOS', '%Y-%m-%d'), TODATE(start_time, 'MICROS', '%Y%m%d'))
Which doesn't work despite any tweaks I make to it. Any ideas?
One way that it can be achieved is by using the New Date Time functions released in the 17 Sep 2020 Update.
The Calculated Field below uses the DATETIME_DIFF function to get the difference between the CURRENT_DATE and the Date field (titled Creation Date in this Report), and can display the result as required, based on the third input of the DATETIME_DIFF function, such as DAY or YEAR:
1) DAY
DATETIME_DIFF(CURRENT_DATE(), Creation Date, DAY)
2) YEAR
DATETIME_DIFF(CURRENT_DATE(), Creation Date, YEAR)
Google Data Studio Report and a GIF to elaborate:
TODAY() worked for me.
Here is an example for calculating date of birth:
FLOOR(DATE_DIFF(TODAY(), TODATE(date_of_birth, '%Y-%m-%d', '%Y-%m-%d')) / 365)
https://issuetracker.google.com/issues/78200216
In my project involving dates calculation I am wondering what is really end of day coming from a previous question:
extract date ranges grouped by day from time intervals
Is 23:59:59:999 end of day or is it 24:00:00:000?
Thanks.
In .Net the property Hour is between 0 to 23 so I think 23:59:59:999 is the correct answer
In MySQL I am using
week(date,3)
to get correct values of week grouping.
How to translate this to PL/SQL? I'v tried the following but what about this 3 from week function in mysql?
TRUNC (created_dt, 'IW')
Oracle is using the NLS setting of the database to determinate how the week number should be calculated and therefor there is no need (according to Oracle) for the '3' part pf the MySQL function. I can image that there still should be useful to have this option but this is once again a sign of the fact that Oracle does not fully understand the needs of working outside USA.
Based on your MYSQL statment above, it returns the week of the specified date e.g. 2012-12-07, 3 as the second argument defines that the third day of the week is assumed as Monday...
If you look at this article it says there are 8 ways MYSQL WEEK() function can behave. So you gotta let us know what results you are trying to achieve by looking for MYSQL Week equivalent function in PL/SQL.
In most staright forward manner, MYSQL WEEK(date[mode]) returns the week number for a given date.
From re-reading your question, the only thing I grabbed that you want to achieve the first feature within PL/SQL and so you are looking for an equivalent function.
And with Oracle it gets slightly RAMEN...
W Week of month (1-5) where week 1 starts on the first day of the month and ends on the seventh. It goes on with how the year starts. E.g. 2012 started on a Sunday, ORACLE THINKS.............. that weeks are Sundays to Saturday.
iw Week of year (1-52, 1-53) based on the ISO standard. Hence the weeks do not necessarily start on Sunday.
WW Week of the year (1-53) where week 1 starts on the first day of the year and continues to the seventh day of the year.
By default Oracle NLS settings are set to following:
NLS_CALENDAR : Gregorian
NLS_DATE_LANGUAGE: AMERICAN
NLS_TERRITORY: AMERICA
So you can suggest Oracle to follow the calendar by manipulating your query level....
You could something like this:
select trunc('2012-12-07','YY') AS week_number,
to_number(to_char(trunc('2012-12-07','YY')+rownum-1,'D')) AS dayNumber_in_week
from dual connect by level <= 365
where to_char('2012-12-07','IW') = 3
and to_char('2012-12-07','DY') = 'MON';