SSRS display one of two possible dates - reporting-services

I have a confirmation letter used to display one of two dates to a customer.
Date.Value is the purchase date of a product not tied to a finite inventory.
InventoryDate.Value is the date an activity is taking place, based on inventory availability.
Everything has a purchase date, but not everything has an inventory date. I would like the letter to display InventoryDate.Value if it has one, or display Date.Value if inventory date is null. I've played around with a bunch of variations in my code, but what I currently have is:
=iif( Fields!InventoryDate.Value="", Fields!Date.Value, Fields!InventoryDate.Value)
This is displaying Date.Value correctly, but returning #Error for any product with an Inventory Date. I am very new to SSRS/Reporting, so please keep any suggestions at a newb understanding level.
Working in MS Report Builder.
Thanks for your suggestions!

Depending on the data type of the fields, they can be blank or empty. With ="" you are only checking, if the field is blank.
try this:
=iif(IsNothing(Fields!InventoryDate.Value),Fields!Date.Value,Fields!InventoryDate.Value)

Related

A row missing from company report (SSRS Dynamics)

I'd like advice for how to investigate this issue - I have a ticket open with Microsoft, but I haven't received a response from them yet. I have a Fetch/XML report that creates a profile of each company and their products, per year purchased. The report works well, but one employee found an error, and I can't explain it.
The report has a tablix that contains 3 columns "Product" "Year" and "Amount". "Year" is a calculated field: =year(Fields!ab_new_yearpurchased.Value). The field ab_new_yearplanted.Value actually contains a full date, but I'm just interested in the year.
The report is missing one of the products. If I change the purchased year in the product (from Feb. 1 2020 to Feb. 1 2019, the product appears on the report.)
If I create a brand new listing for the product, with the correct info, it won't appear on the report. If I change it to a 2019 date, it appears.
As far as I can tell, this error is only happening with one company.
I assumed the problem was the =year formula somehow, so I redid the report without the formula, just per purchase date. The row is also missing, but the total sum of the tablix includes the amount of the missing row.
Other than waiting for Microsoft to get back to me, can anyone recommend what else I can check here? Thank you.

MS-Access database help needed

I am a beginner in using Access. In the past I used a database where I could select a beginning and ending date on a calendar, and the query would bring back all items that would "occur" during those dates. I would like to replicate that database.
The records would need to be pulled based on their frequency- for example I have items that occur on a monthly (on a certain date), weekly (on a certain day), bi-weekly (every other day of the week). (There are codes to represent this- for example PPBR would be every other Thursday; PPM23 would be the 23rd of each month; PPWT would be weekly every Tuesday). Like setting up a reoccurring appointment in outlook, these items would also continue for future dates so that I know when they need to occur next by just clicking on the calendar.
For example, on Tuesday June 23rd, all items that occur every other Tuesday, items for the 23rd and weekly on Tuesday should all be pulled into one report.
I have created a table for the main record info. I have also created a separate table listing all the variations of the frequency (code and day of week/date they occur) and have linked them.
I am stuck at this point as to how to create and incorporate the calendar function and would appreciate any assistance.
Thank you!
June7's comments direct you to ask a more focused question. I gather that you are simply asking how to incorporate "calendar functionality", but your detailed description muddles your intention.
Since you've create something like this before, I presume that the "calendar" you mean is simply the calendar-style date picker already available with the TextBox controls. In that case, you could add two unbound TextBox controls --one for the beginning date and one for the ending date-- and set the following properties in the Property Sheet:
Format: Short Date
Show Date Picker: for dates
After Update: [Event Procedure]
With the Show Date Picker property enabled, upon clicking inside the TextBox control a little Calendar icon is displayed. Clicking on that icon shows a pop-up date picker.
In the TextBox_AFterUpdate event handlers add code to update the Form's RecordSource with an appropriate query. (It would also be possible to refer to the TextBox values directly in a query, but your description of the date criteria sounds too complicated to handle in a single query directly.)

Sort differing date formats in Access?

I have an Access database in which a report is pulled and displayed based on city and state. There is a form where the user selects city and state and a query is run, then a report displayed based on that query. I want to sort the data from the query by Warranty Start date(WSD) then Model #. The problem is that all of the dates aren't in the same format and if I try to format the WSD column as a date field Access Deletes at least 1000 records. Currently all fields are formatted as short text. Is there a way that I can sort the data by date without the format being the same for all? I have attached a screenshot of some records to show the issue.
If you need the sql query I can provide that as well.
If you wish to sort by the date, then you can use:
IIf(IsDate([WSD]), CDate([WSD]), DateSerial(Val([WSD]),1,1)) AS WarrantyDate

Calculating a date in access reports?

I have a report where the user enters a FROM and TO date. What I'm trying to do is allow the user to view the inventory of the last day of the previous month. So lets take for example: user enters 12/7/2015, I want to be able to show the beginning inventory between 1/1/2000 and the last day of this dates (12/7/2015) which would be 11/30. I'm running this in VB6 just to make sure the number are correct. I've seen other answers on SO but for some reason I'm getting different results.
I try to run this but get a weird date...
?DateSerial(Year(12/1/2015),Month(12/1/2015),0)
Thsi gives me the following results...
11/30/1899
So the date seems to be okay, but the year is way off. Why?
Use Date:
DateSerial(Year(Date()),Month(Date()),0)
or, for a specific month:
DateSerial(Year(#12/1/2015#),Month(#12/1/2015#),0)

How to create a Multiple date picker for a search form

I am quite a newbie to MS Access.I am working with a search form in MS Access and I want to create a date picker in which I can select multiple dates which will be an input for a Query that is used to search and display the results from my table for the records that have the selected dates. I did some research on this,however I was unable to find out a feasible solution for my problem.
As I see there are only 2 ways in which this can be done.The first way is that is using two date pickers one for from date and other for to date and then search for the records between these days which is not very feasible for my scenario as I might want to choose two different dates for example 4th of Jan and 6th of Jan and display results for only those days.
The other method is to use a list box which displays all the dates that are present in the database and choose from that however this is not going to work for me as if I have a very long list of dates such as from 1st Jan to 31st Jan then it would be very time consuming and also I might select a date which I do not want to to search for also in the results.
Could anybody suggest me how can I solve this problem.I am looking for a multiple date picker property in access.Is it possible to achieve this through the form properties? If yes how can it be done? Or is there any other solution for this problem?
Thanks in Advance.
I would recommend creating a temp table consisting of two fields, a Yes/No field and a Date field. Populate the date field (don't name it 'date') with all of the dates from your list of dates. Then on your search form add a subform bound to the temp table. Users would simply check the box next to the desired dates. Then modify your query to include the temp table with a join on the date fields and criteria that the Yes/No field is True (Yes).
Its doubtful youre still looking for this but for anyone else that happens accross this topic I modified an existing datepicker to allow selection of any number of non-contiguous dates, and insert them to a table. I posted it on UtterAccess (A great forum for Access questions). A link to the forum topic is below, but you need to create an account to download the example file.
http://www.utteraccess.com/forum/index.php?showtopic=1738361&st=0#entry2535392
You could combine the two approaches and have
Two textboxes to filter for a short date range (say 1 month dates)
Show the dates in this date range in a multiselect listbox where the user can select the specific dates they need.