Microsoft Report Builder - Need to convert Charge Posted Period to previous month - reporting-services

I am new to Report Builder and do not have all of the fields that I usually would have. I have a report that the filter currently is set to Charge Posted Period = 7 and Charge Posted Period = 2021. I need to find a way to convert the Charge Posted Period to look to the last period/month so I can schedule the report to run. I have tried multiple queries and functions which did not work. enter image description here
Has anyone worked with this report builder and can guide me to correct this filter?
Note: The field Charge Posted Period is not a Date type field, I believe it is an aggregate type field.

I would make the query for the Period parameter to be based on the year selected. Then your drop-down would only contain periods in that year.
SELECT [Charge Posted Period] AS AVAILABLE_VALUES,
MAX([Charge Posted Period])OVER() AS DEFAULT_VALUES
FROM TABLE
WHERE [Charge Posted Year] = #ChargePostedYear

Related

SSRS select parameter month and change par. first and last day of this month

i need to create parameter list of months and then (after select) recalculate two others paramateres in date format ([first day] and [last day]) of this month, can you please help me?
You are querying a database server to generate the list of months, although there's no need to do that. I suggest to rather create a list of months in the report and let the report calculate the month's names, so the language depends on the Language setting of the report (which can be the language configured in the user's browser).
For example, to calculate the Label for the Value 1, use an expression like =MonthName(1).
The Parameters FirstDay and LastDay (or just the values whenever you need them) can be calculated using these expressions:
FirstDay: =DateSerial(Today.Year, Parameters!Month.Value, 1)
LastDay: =DateSerial(Today.Year, Parameters!Month.Value, 1).AddMonths(1).AddDays(-1)

Display the difference between 2 columns where multiple columns associated from dynamic matrix in ssrs 2008 r2

enter image description hereI have to show the data in the report just like above .. i need to get the difference of Medicaid 2017 value and Medicaid 2016 in Med diffrence
commercial 2017 value and commercial 2016 in commercial difference column... note that 2016 & 2017 are dynamic values as year changes these will change..any pointers would really help? please see the attached images data & matrix
Appreciate your response.
Thank you!!!! enter image description here
Each row is going to be grouped by the salesperson so the only thing we need to detect for our calculation is the year.
=SUM(IIF(Fields!Year.Value = "2016"), Fields!Medicaid.Value, 0)) - SUM(IIF(Fields!Year.Value = "2017"), Fields!Medicaid.Value, 0))
What this does is run the sum function through the dataset (with group filter). In sum we can nest the IIF logic to detect what the year field is in the dataset. If it is the year we are looking for, we return the value of the data (in this case the medicaid value). The end result is the sum of all values matching the date. Then we subtract that by the next year and there is your difference.
I know you want to keep this dynamic. You'll have to test your own solutions since I'm not sure how you will handle this in your data. Assuming at the very next year this will flip to current year and previous year, instead of hard coded year you would use:
Now().Year and Now().addYears(-1).Year
I think all this code should work but I did not test. You might have to confirm those VBNet DateTime functions. Just tried to get you an answer on my lunch break!

MS Access Date Grouping is not working in report

I have created a simple Microsoft Access 2007 app of receiving and paying vouchers, everything is working properly but one thing that my mind doesn't solve.
I have created a report template of "Receiving Amount" where I want report be grouped in respect of receiving date. I have added a field named "Receiving Date" in "Group, Sort and Total" and when I generate it, it doesn't group the content in respect of date.
Adjust your Grouping and Sorting to use the expression:
Fix([Receiving Date])
I found the solution.
The reason of not grouping date wise because Access could not understand the date, like Gustav said, format is just for display but actual value is different and Sergey S said "If the field with date contains time. you won't be able to group the report".
Finally, I had to remove time from the date and keep it clear to Access so it can group my report.
=MonthName(DatePart("m",[receiving date])) & " " & Format$([receiving date],"d"", ""yyyy")
Where receiving date is the field name.

Can't get the Today() function to work properly in MS Access 2016 Custom Web App

I'm trying to setup a query that will show me all of the records in a particular table where the listed expiry date is either in the past or upcoming in the next 6 months (approximately).
At the moment, I have the "Expiry" field added to my query and the 'Criteria' as .
When I try to save the query, I get the following message:
Access can't evaluate an expression or convert data because data types aren't compatible with each other.
TECHNICAL DETAILS
Correlation ID: ae68949d-3041-3000-0984-71635f8fd670
Date and Time: 7/28/2016 6:54:34 PM
I've tried searching the web for a solution, but most websites refer to the Date() function that doesn't seem to be available in the Access 2016 Custom Web App. When I take out the "+180", it works fine but obviously doesn't give me what I need.
Any help would be appreciated.
=============================
UPDATE:
Some users have asked for my SQL and Table Design details. I don't seem to have any way of accessing the SQL View (the option doesn't appear), but here's a copy of my table view:
Access Query Table Design
In the table, 'Active' is a Yes/No field and 'Expiry' is Date/Time.
Try
< DateAdd(Day, 180, Today())
as criteria.
According to https://msdn.microsoft.com/en-us/library/office/jj249452.aspx this should work in a custom web app.
Error says that you have two different date types and they can't be compared. so, as the Today() returns only the Date with 12:00 pm, I can guess that your other "Expiry" Field is a datetime type. So, you can do either: use Format function to convert datetime to date like this
Format([2/22/2012 12:00 PM],"dd/mm/yyyy")
or use Now() function which returns datetime,
or Share your Code :)

How to get current month name in SSRS?

I need current month name as default perameter name in my ssrs report. How can I get current month name using an ssrs expression?
For example "27-09-2012" would become "September"
and one more i need....
27-09-2012 to previous month name as well (August)
First question:
=MonthName(Month(Fields!datefield.Value))
Second question:
=MonthName(Month(DateAdd("m", -1, Today())))
I think the second question answer might be something like that, first converting the date to month then subtracting 1 from the month value and then converting it to month name.
Further reading:
SSRS Reports get Month name from Month Index or from date
Converting month number to month name in reporting services
OFF: I would change the date format you are using to 2012-09-27 as it works in every setting and should give you peace of mind when converting date formats.
Don't subtract 1 b/c it won't work for January.
Use this:
MonthName(Month(DateAdd("m", -1, CDate(Today))))
As a note, I tried the suggestion of =MonthName(Month(today())). What I would get is #error for whatever field the expression was in. However, =MonthName(str(Month(today()))) worked for me. I am unsure of whether or not the MonthName method changed to require a string or if it is some issue with my program. Just figured I would post this in case anyone else was having the same issue.
For Previous Month i found universal way : =MonthName(Month(CDate(Today()))-1,False) for SEPTEMBER (Full Month Name) 'OR'
=MonthName(Month(CDate(Today()))-1,True) for SEP (Short Month Name)