Comments
8 comments
-
Are you saying that the dataset of the first dropdown changes? I'm not sure how that would work.
-
Can you upload an image of what this report looks like?
-
I'm thinking that you probably want to use a stored procedure for the dataset if your data is in SQL Server.
-
Hi Kathi,
The first dropdown would dictate the whether we wanted to know the data for departures, or returns for a certain date, fed in by another parameter date dropdown. let's say it's an Holiday Scheduler. And i want to know the Airport, Airline, departure time, passenger info etc for all holidays for a date. But depending on the first dropdown, the reports is going to give me departures for that date, or returns for that date.
So the query would be
Select DepartureDate From Schedule
Or
Select ReturnDate From Schedule
Hope that makes it clearer.
Thanks -
Probably the easiest way to do this would be to have the second drop down be based on a stored procedure that has an IF so that the correct query runs. But, you might be able to do something with a UNION of the two queries. I have a meeting in a couple of minutes, but I'll get back to you with some pseudocode after that.
-
Assuming that the first parameter is called @Type and it returns a string of either "DepartureDate" or "ReturnDate" then this query would work:SELECT DepartureDate AS TheDateFROM ScheduleWHERE 'DepartureDate' = @TypeUNION ALLSELECT ReturnDateFROM ScheduleWHERE 'ReturnDate' = @Type
-
To link two variables in your scenario, you can use conditional logic based on the first drop-down selection. If the user selects "Departure Date" or "Return Date" from the first drop-down, this would dynamically filter the data source to show the corresponding column (Departure or Return) in the second drop-down, which is the date selector. This approach ensures the correct date is linked to the appropriate data.https://trafficrider.racing/
-
To link the two drop-downs:
- First Drop-down (Source Selector): Let the user select between "Departure Date" or "Return Date."
- Second Drop-down (Date Selector): Populate the second drop-down with dates based on the first drop-down selection.
Implementation:
- When the first drop-down selection changes, dynamically filter the second drop-down to show either departure or return dates from your table.
Example (pseudo-code):
javascript
Copy
firstDropdown.addEventListener("change", function() { var selectedSource = firstDropdown.value; dateDropdown.innerHTML = ''; // Clear previous options // Populate second dropdown based on selected source if (selectedSource == 'Departure Date') { populateDates(departureDates); // Use departure dates array } else if (selectedSource == 'Return Date') { populateDates(returnDates); // Use return dates array } }); function populateDates(dates) { dates.forEach(function(date) { var option = document.createElement("option"); option.value = date; option.textContent = date; dateDropdown.appendChild(option); }); }
This way, the second drop-down dynamically updates based on the first selection.
Traffic Rider APK is an absolute must for motorcycle game enthusiasts. The modded version gives you a ton of freedom with no restrictions, allowing you to experience the game to its fullest. Plus, the variety of environments and challenges keeps things fresh and exciting!
Add comment
Please sign in to leave a comment.