Why is my datediff formula not working? - reporting-services

Good day,
I'm trying to get the difference of months between two different fields. I understand that the "datediff" function should meet my needs. However I am receiving an error. Is my syntax incorrect?
=datediff("mm", Fields!MaturityDate.Value, Fields!DateLastActive.Value)
Thank you!

Use datediff(DateInterval.Month, Fields!MaturityDate.Value, Fields!DateLastActive.Value) instead.

Related

Between 2 dates form Validation Access. I've tried many different things and nothing works

I'm having a hard time figuring out why my code isn't working with this front end form validation rule regarding a range of dates.
So far I've tried many different solutions stated below that have kept yielding me the same error. The data I've been inputting is 03/29/2021 and it's giving me an error when it should be in that range.
Does someone know why and how to go about fixing it? Thank you!
Between #1/1/2012# and Date()
Not IsNull([Date]) And Between #1/1/2012# And #1/1/2024#
Not IsNull([Date]) And Between #1/1/2012# And Date() (I would like to use this one the most to eliminate as much human error as possible)
Not IsNull([Date]) And Between #01/01/2012# And #01/01/2024#
Not IsNull([Date]) And Between #01/01/2012# And Date()
Not IsNull([Date]) And Between #01/01/2012# And >= Date()
This setting for the validation rule works:
Between #01/01/2012# And Date() And Not Is Null

GroupBy Query over YRBSS Socrata API

Need help to build a sample query to get YRBSS 2015 statistics for questioncode H43 and grouped by race. I was following docs1 and doc2 and was able to get complete data for 2015 by following query:
https://chronicdata.cdc.gov/resource/6ay3-nik2.json?$where=(StratificationType='State' OR StratificationType='National')&year=2015&questioncode=H43
However $group=race is not working(is this possible? please advice). Any help would be much appreciated.
This question might not look technical but since support center suggests to post questions on stack overflow, I'm posting it here
What was your query using the $group=race? You will need to have a select statement and some aggregation function (e.g., count, sum, etc.).
Guessing that you want counts of individual responses by race, this statement will work:
https://chronicdata.cdc.gov/resource/6ay3-nik2.json?$select=race,count(race)&$where=(StratificationType=%27State%27%20OR%20StratificationType=%27National%27)&questioncode=H43&year=2015&$group=race
It's preceded by $select=race,count(race) to provide counts.

Unable to get the Query Results

i am a newbie to SQL. i am not able to figure out what is the solution to this question where i have to filter a query through date.
Please have a look at this image.
Please tell me Where am i doing it wrong.
thanks
There is a sentence appointing to what you are doing wrong. In this case, it is a typo: date is missing 0.
Your date should be 2015-10-01. You're missing a zero in the day portion.

isnull in SSRS expressions

How to use this formula in ssrs-expression
=NOT(isnull({Command.AAID})) or NOT(isnull({Command.HDomain}))
or NOT(isnull({Command.Adomain}))
Thanks.
I think what you're trying to do is display data based on whether or not a field has data in it or not? You can always use an IIF statement with ISNOTHING. See below for the expression.
=IIf(IsNothing(Field!Whatever),0,Field!Whatever)
If that doesn't answer your question, let me know.
So to convert Crystal formula to SSRS-Expression,
You need to write expression like below,
=IIF(Not(IsNothing(Field!AAID)) OR Not(IsNothing(Field!HDomain)) OR NOt(IsNothing(Field!Adomain)),"TruePart","FalsePart")
This expression will work for you!

sum 2 columns in a reporting services matrix

I have matrix in my report having column field "Layer Origin".
Layer Origin has 3 values:
New Business
Renewal - Rewritten
Renewal - Same Terms
if i run the report as is it will show Totals for each of the 3 above.
What i what is to show the Totals for:
New Business
Renewal (Renewal - Rewritten + Renewal - Same Terms)
i.e.: i want to sum the values of Renewal-Rewritten and Renewal- Same Terms
Below is a screen shot to illustrate my request.
Thanks for your reply.
ive tried the below code but it gave me error (see the below screen)
=SUM(IIF(Fields!Layer_Origin.Value="New Business",0,Fields!USD_Cedent_Premium.Value))
I appreciate your feedback.
This situation can be handle if you just use conditional SUM in Total Column
=SUM(IIF(Fields!Layer_Origin.Value="New Business",0,Fields!USD_CED.Value))
Instead of using
=SUM(Fields!USD_CED.Value)
I think it will solve your problem. Pardon me if some spell mistake or syntax error. As i dont have any VS intalled to check.
Share if you still face any issue bcz this one is definetly i can help.
After Several testing i found the problem.
the code should be as below:
=SUM(IIF(Fields!Layer_Origin.Value="New Business",CDec(0.00),Fields!USD_Cedent_Premium.Value))
Thanks for your assistance