Constrain available date values in SSRS - reporting-services

Is it possible to constrain the calender prompt? I want that the users only can select current and the last year. But not more. Now they can select all years infinite.

Related

How to find records within a certain timeframe based on another field

How do I find all records 7 days before a field in an SQL database?
I need to find all transaction dates that were placed 7 days before the pickup date of the same record.
I am currently using SequelPro so that my have an effect on available syntaxes.
This is currently my table that I am pulling the records from.
This is the exact question I am being asked;
Write a query to display all details of transactions that were made at least one
week before the pickup date.
Isn't it straightforward?
SELECT * FROM TransactionTable
WHERE DATEDIFF(pickupdate, transactiondate) >= 7;

how do i group customer entries using months across different years in ssrs reports in nav

I am trying to get Sum of each customer ledger entries and group the Ssrs report into months across different years. For instance, I should be able to filter with the year 011117..310318, this should give me entries of each customer grouped per month: November, December, Jan(18), Feb, Match.
You can do this by using a matrix in your report.
Add the matrix and set the row group to group by Customer (whatever makes the customer unique such as an ID).
Add column groups by month and then a parent column group by year. If you don't have separate columns for months and years in your dataset, you can use expression into the group expression such as..
=Month(Fields!myDateField.Value)
=Year(Fields!myDateField.Value)
In the data 'cell' just drag the value you want to aggregate there.
That should give you a basic working matrix.
If you need more help refer to the SSRS documentation on the matrix control.
https://learn.microsoft.com/en-us/sql/reporting-services/report-design/create-a-matrix-report-builder-and-ssrs?view=sql-server-ver15

Display different values based on dates stored in a table in Access [duplicate]

This question already has answers here:
SQL/VBA: How to group by a fiscal year starting from a day other than 1st day of month
(2 answers)
Closed 3 years ago.
I have a set of data, orders from customers on every date.
I use seasons in my company to compare sales. The seasons are not defined by the year but from certain dates ie. Season 2019 - From: 01/05/2018 - To: 30/04/2019.
The data for the Seasons (SeasonName , From , To ) are stored for all seasons (2018, 2017 etc) in another table in Access.
I want to create a field in a query of Access that checks the date of the order and if it falls between the range defined in the Seasons table, to display the equivalent SeasonName.
In Excel I would do it using index and match but in Access I need your help about it!
Thanks a lot!
The easiest way is to use a Calendar table. You can link your dates to this table to retrieve the corresponding SeasonName. You can generate the data for this table in Excel then import it into Access. Here's an example of a Calendar table https://www.excelcampus.com/tables/calendar-table-explained/.
The ideas are the same for Access. Build your table with your required dates and then add the SeasonName info for each date.

MySQL - is it possible to display empty rows? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Displaying zero valued months with SQL
For a certain attribute, is it possible to display its rows even if its empty?
Say I have attribute date_of_car_sale. Also, let's say I want to do a monthly report.
From January to December of 2009, there's two months where the company has been away on holiday, so there's no date_of_car_sale for June and August.
Is it possible to make a report that displays every month of 2009, even if June and August has no data value?
I can make every month show and by grouping them to show individual months only. But can't seem to get June and August to display because they're empty.
PS: This only requires one column from the table Company.
In cases like this, I usually make a table with all values I want displayed and do a left join to my data set. So in your case, I would make a table called "months" with a single date column that stores the first day of the month or maybe two columns with the first and last day and do join like this:
SELECT m.month_first, COUNT(x.date_of_car_sale) as sales
FROM months m
LEFT JOIN (
SELECT date_of_car_sale
FROM sales
) x ON m.month_first <= x.date_of_car_sale
AND m.month_last >= x.date_of_car_sale
GROUP BY m.month_first
ORDER BY m.month_first

How to get month using date in MySQL [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
how do I get month from date in mysql
I want to get month using date example 2011-04-02 so I want month april. How to get this in MySQL?
SELECT MONTHNAME(date) AS monthName for January, February...
SELECT MONTH(date) AS monthName for 1, 2...
SELECT MONTHNAME(`date`) AS month_name FROM table_name;
You can use MONTHNAME() to get the month name. If you want month number, consider to use MONTH()
You can have a much more elegant solution to this if you use a second table as a date dimension table, and join your date field to it, in order to extract more useful information. This table can contain dates, month names, financial quarters, years, days of week, weekends, etc.
It is a really tiny table, only 365(ish) rows per year of data you have... And you can easily write some code to populate this table with as much data as you require. I did mine in Excel, exported as a CSV file and then imported the data into a blank table.
It also gives lots of benefits, for example, imagine a monthly data table with the following fields (and any others you can think of!) fully populated for all the months in a given range;
Date (E.g. 2009-04-01)
Day (E.g. 1)
Day of Week (E.g. Wednesday)
Month (E.g. 4)
Year (E.g. 2009)
Financial Year (E.g. 2009/10)
Financial Quarter (E.g. 2009Q1)
Calendar Quarter (E.g. 2009Q2)
Then combining this with your own table as follows;
SELECT `DT`.`monthName`
FROM `your_table`
INNER JOIN `dateTable` as DT
ON `your_table`.`your_date_field` = `dateTable`.`theDate`
There are many other nice outputs that you can get from this data.
Hope that helps!