Error when using DateAdd on a parameter in SSRS - visual-studio

I am trying to set a range of dates. I receive a parameter called #EffectiveDate and i want to set a range from 3 years prior to the effective date.
As an example. This is working code.
CStr(Format(CDate(DateAdd(DateInterval.Year, -3, Today())),"yyyy"))
But when I try to use the parameter like below
=CStr(Format(DateAdd(DateInterval.Year, -3, CDate(Parameters!EffectiveDate.Value)),"yyyy"))
I get an error. I don't know what the error is. All i see is #Error when running the report.
The parameter is set up as "Date/Time" in SSRS and I even convert it just incase.
The following code does work though
=CStr(Format(CDate(Parameters!EffectiveDate.Value),"yyyy"))
So it does seem like it is the "DateAdd" method
Any help would be greatly appreciated. Thank you

Can you try this code
=CStr(Format(CDate(DateAdd(DateInterval.Year, -3, CDate(Parameters!EffectiveDate.Value))),"yyyy"))

Try if this works
=CStr(Format(CDate(DateAdd("yyyy", -3, Now())), "yyyy")) 'Result =2015
and if this works try it with your Parameter (instead of Now()). If it doesnt work then, something is wrong with your Parameter

Related

Why can't I pass these arguments in Remix?

I'm trying to deploy OpenZeppelin PaymentSplitter.sol but I'm getting the following error in Remix:
creation of PaymentSplitter errored: Error encoding arguments: Error: expected array value (arg="", coderType="array", type="string", value="0x075e829D8420786210b728df8D75CE2E5375A57a")
I've tried passing:
"0x075e829D8420786210b728df8D75CE2E5375A57a",10 (I believe this should the correct way)
"0x075e829D8420786210b728df8D75CE2E5375A57a", 10
0x075e829D8420786210b728df8D75CE2E5375A57a,10
"0x075e829D8420786210b728df8D75CE2E5375A57a", "10"
but each one produces the same error.
Can anyone shed any light on why this isn't working, please?
Thanks in advance
The parameters expected are in array, so if you wanna pass those above values, pass like this:
[0x075e829D8420786210b728df8D75CE2E5375A57a], [10]
Hope it helps!

Sonar API search issues

I am trying to get the issues(bug,codesmells) through sonar API by using the following
/sonar/api/issues/search?pageSize=1&projectUuids=AV7s-_ldd2-CFpJxZLc4&types=BUG&createdAt=2017-11-08&resolved=false
Its working well, But what I am looking here is, instead of giving the date manually, Is it possible to pass the date which I will get it from script?
My codes :
wget.download('http://00.00.00.00:9090/sonar/api/project_analyses/search?project=project-id',out='file1.json',bar=None)
data = json.load(open('file1.json'))
date_time=(data["analyses"][0]["date"]).split("'")[0]
date=date_time[0:10]
print date
I need to pass the output(date) to,
/sonar/api/issues/search?pageSize=1&projectUuids=AV7s-_ldd2-CFpJxZLc4&types=BUG&createdAt=date&resolved=false
Any suggestion?
Call api/issues/search with a date format that respect one of the 2 formats:
2017-10-19T13:00:00+0200
2017-10-19

VBA application.run, MAc excel 2016

Once again thanks in advance for your help.
I am having trouble using application.run, it does not report any error but the code crashes. The project is big and application.run was the simplest way I found to pass a function as an argument...
I simplified the issue to this:
MsgBox Application.Run("Application.WorksheetFunction.Var_S", ThisWorkbook.Worksheets("Data").Range("B3:B974"))
This is simplified, but I cannot manage to get even this to work.
However the following gives the intended result hence the issue is from the use of application.run and not the var function itself.
MsgBox Application.WorksheetFunction.Var_S(ThisWorkbook.Worksheets("Data").Range("B3:B974"))
Hence I know the issue comes from the way I use application.run. As I said no error is reported but the code stops. nothing is returned and anything after application.run is not executed..
My guess is that I do not have the correct syntax, but I could not find lots of documentations about this. Based on what I read this is supposed to be the correct syntax.
Thanks
Instead of Application.Run you can use
MsgBox CallByName(Application.WorksheetFunction, "Var_S", VbMethod, _
ThisWorkbook.Worksheets("Data").Range("B3:B974"))
Function Var_S returns a value. You're not getting an error because it's running properly. In example #2 you're telling it what to with the returned value. What should it be doing with the response in example #1? If you'd like to simply further as an example, instead the Var_S function, try it with the Now() function, which returns current date: Application.Run "now()" ... again, it runs the function just fine. Application.Run runs a function, whereas MsgBox displays data.

Sharepoint 2013 Column validation not working

I have a few columns in a list and one is called Supervised, the other relevant one is called Co-Supervisor.
I'm trying to force Co-Supervisor not to be blank if Supervised="Yes" but cannot get the column validation to work!
I've tried several different formulas in the Co-Supervisor column validation settings. I always get an error. Please help!
This is an example of one of the formulas I've used:
=IF([Supervised]="Yes",TRUE,FALSE)
I've also tried:
=AND([Supervised]="Yes",(NOT(ISBLANK([Co-Supervisor])))
What am I doing wrong?
Please use below formula:
GoTo List settings
GoTO validation settings
Use below mentioned formula
=IF([Supervised],IF([Co-Superviser]<>"",TRUE,FALSE),TRUE)
I have tested this on my environment and it is working fine.
(Note : Yes/No fields are internally stored as bit/boolean.So IF[Supervised] will directly evaluate to True/False.
Reference - https://sharepoint.stackexchange.com/questions/89188/calculated-column-issue-with-if-statement-and-yes-no-field
)

Descendent-or-self in InfoPath

I want to use XPath code in an InfoPath form to sum the data in field12 when field11 is equal to IT. I tried using the following code, but it doesn't work.
number(sum(/descendant-or-self::node()/my:group12[my:field11 = "IT;"]/my:field12))
I suspect this has to do with the multilayering of groups, as shown below. Does anyone know the code that would allow me to get to the data in group12? Thanks in advance for your help.
myfields>group9>group10>group11>group12>field11 field12
Genipro
Looks like:
number(sum(/descendant-or-self::my:group12[my:field11 = 'IT;']/my:field12))
could be right.
decendant-or-self should not be necissary in this case (unless you need the expression to work even if group12 is moved).
This should work fine:
sum(/my:myfields/my:group9/my:group10/my:group11/my:group12[contains(my:field11,'IT')]/my:field12)
It doesn't matter if any of the other groups are repeating either. All group12's will be checked.

Resources