SSRS Current Month Parameter - date

I have cascading date parameters year, month, date. I want SSRS to dynamically populate the current month automatically.
For year I used ="[Date].[Year].&["+CSTR(Year(Today))+"]" and worked fine.
For Month I used ="[Date].[Month].&" & Format(Today(), "YYYYMMMM") and IS NOT working.
My Month Parameter format is: 2016 September
Thanks in advance for your help.

Try:
="[Date].[Year].[Month].&["+ Cstr(Today.Year) + " " +
StrConv(MonthNAme(Today.Month),vbProperCase) +"]"
Also this should work
="[Date].[Year].[Month].&["+ StrConv(FORMAT(Today(),"yyyy MMMM"),vbProperCase) +"]"
Let me know if this helps.

You could probably try and use the CDATE function:
=Format(CDATE(Today()), "yyyy MMMM")

Related

how to make a day from date in LibreOffice?

I want to convert date into a Day
I am using LibreOffice
I used some of its syntax weekday and text but it returns nothing
WEEKDAY("30-04-2019"; 1) is there any way to do that?
in google sheet i used =TEXT(C7758,"dddd") but it didn't work
how can I do that?
thanks in advance
Try the combination of functions WEEKDAY and DATE:
=WEEKDAY(DATE(2019;4;30))
The specific example will return 3 which is Tuesday (see all days and other options at https://wiki.openoffice.org/wiki/Documentation/How_Tos/Calc:_WEEKDAY_function)
Hope that helps.

Erlang - invalid/wrong date

How can I validate a date in Erlang?
What happens is that, for example, the date 2018-02-31 is a "valid date" in the sense that I can work with it. When I insert this date on a table (field date) it converts itself to 2018-03-03 (2018-02-28 + 3 days).
What I want is a way to let me know that the original date of my example (2018-02-31) is indeed an invalid date.
Thank you.
Try to use calendar module
calendar:valid_date(Date) -> boolean().
calendar:valid_date(Year, Month, Date) -> boolean().
You will receive true or false
The detailed information and correct input format is here Erlang Calendar Module
I found out that this works just fine for me:
calendar:valid_date()
Thank you.

Formatting a date retrieved from Wikidata

So let's say I have an Infobox template in Wikipedia that retrieves a company foundation date from Wikidata. It contains the following code:
|label7 = Year founded
|text7 = {{wikidata|p571|{{{founded|}}}}}
My problem is that what's retrieved is formatted as 31 January 2010 and it looks weird next to "Year founded' since it is not a year but the whole date. Of course I could rename the label from "Year founded" to "Date founded" and voila, problem solved, right? But I do want to just get the year from Wikidata, not the whole date.
What would be the code for this? I imagine something like {{wikidata|p571[year]|{{{founded|}}}}} or {{wikidata|p571[0]|{{{founded|}}}}} or {{wikidata|p571[YYYY]|{{{founded|}}}}}.
Thanks in advance!
This doesn't sound like a programming question, but it looks like you can request a specific date format as the third parameter to wikidata
https://en.wikipedia.org/wiki/Module:Wikidata#Testing_getValue.2C_getRawValue_and_getDateValue
{{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|y}}
I highly recomend you to filter the year from date using RegularExpression instead of trying to get only the year.

How to get the last day of the current month in DataStage?

I have explored all the functions avialable in the trasformer, but could not found the exact function to get the last day of current month by passing date in same default format i.e. yyyy-mm-dd.Please help me in this regard.
Field("31|28|31|30|31|30|31|31|30|31|30|31", "|", MonthFromDate(InLink.dateVar))
It is more precise to establish the first day of next month then use DateFromDaysSince function to establish the day before. I created an integer(6) stage variable which contained century and month+1 from source link e.g. 201410
DateFromDaysSince(-1, StringToDate(svIHBKPR, "%yyyy%mm") : "%yyyy-%mm-%dd")
There is a transformer function called DaysInMonth.
Example: DaysInMonth(“2017-01-23”)= 31

why does ColdFusion's DateDiff return strange/negative values?

Pulling my hair out again...
I need to calculate the difference between two dates in days. I'm doing this:
<cfset d = DateDiff("d", Dateformat( active_apps.app_base_coupon_start, "dd.mm.yyyy"), Dateformat( variables.useDate, "dd.mm.yyyy") )>
With active_apps.app_base_coupon_start = 27.07.2012 and variables.useDate = today = 02.10.2012.
I dumped both values, they are OK. However the dateDiff returns -168 when I was looking for (4 days in July, 31 in August, 30 in September, 2 in October) 67 days.
Question:
Can someone prevent me from losing my remaining hair and tell me what I'm doing wrong here or if there is an easier way to get the difference in days?
EDIT:
Ok, it also works like this:
<cfif DateAdd("d", active_apps.app_grace_time, Dateformat( active_apps.app_base_coupon_start, "dd.mm.yyyy") ) GT now()>
<cfdump output="e:\s\page\t\dump.txt" label="catch" var="YUP">
<cfelse>
<cfdump output="e:\s\page\t\dump.txt" label="catch" var="NOPE">
</cfif>
but I would still like to know, why dateDiff is returning strange values.
DateDiff("datepart", date1, date2) takes a datepart and two date objects as arguments.
DateFormat() as Adam Cameron already said returns a string and not a date object.
ColdFusion is trying to read "27.07.2012" and "02.10.2012" as date objects by trying to apply some known date formats. That's why "02.10.2012" is interpreted as "Feb 10 2012".
I wouldn't let ColdFusion guess the dateformat of your string. Instead you should create date objects by using CreateDate(year, month, day).
now() is also a ColdFusion date object.
First things first, dateAdd() takes DATES as arguments, not dateFormat()-ed strings. dateFormat() is for output, not for calculations.
You need to understand that just because "02.10.2012" looks like a date to you (and to me), it's not a date as far as the computer is concerned: it's a string.
Never use strings for date calculations.
In your case, CF is valiantly trying to work out what "02.10.2012" might mean as a date, and deciding it's "mm.dd.yyyy" format, which is Feb 10, whereas you mean Oct 2.
You're using an ambiguous date format. Change the DateFormat to international date format (ISO 8601) whenever you make date calculations and things will be a bit more predictable. Note that CF doesn't support every variant of the ISO format, but for the most part you just need yyyy-mm-dd which is supported.
<cfset d = DateDiff("d", Dateformat( active_apps.app_base_coupon_start, "yyyy-mm-dd"), Dateformat( variables.useDate, "yyyy-mm-dd") )>