Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
jcarver
Starting Member
18 Posts |
Posted - 2007-07-18 : 10:27:33
|
I have a problem with getting a dropdown list to change a txt field every time I select a new value on it. I have a parameter called "Type" that is selected from a non-queried drop down list. This contains values like "Month" "Day" "Quarter" "Week", etc. I have a query that takes those parameters and then returns a "TimeInterval" for each one. I want this value to appear in a text box (Which is a MaxDate parameter for an entirely separate query) whenever the user selects a value from type. However there is a catch, the user needs to be able to also change the value of the textbox so that he/she can customize that end date for report rather than the values that I have pre-canned for them. This is a bit confusing so I'll try to give an example. The wants to run a report and selects "Week" from the drop down list, this value is passed one of my datasets and that data set returns the value 07/15/2007. That value will then populate in the MaxDate parameter field. The user then changes his/her mind selects "month" from the Type drop down list. What should happen is that the MaxDate field changes to be 07/01/2007 (This is returned correctly in my querry, but I can't get it to show in the maxDate field after the first time.), but instead it still shows 07/15/2007. Here is my SQL code for the dataSet that uses the parameter Type to return a date IF(@Type= 'Day')BEGINSELECT dbo.F_START_OF_DAY(getdate()) AS TimeIntervalENDIF(@Type='Year')BEGINSELECT dbo.F_START_OF_YEAR(getdate()) AS TimeIntervalENDIF(@Type='Month')BEGINSELECT dbo.F_START_OF_MONTH(getdate()) AS TimeIntervalENDIF(@Type='Quarter')BEGINSELECT dbo.F_START_OF_QUARTER(getdate()) AS TimeIntervalEND ETC.................................... If you need any aditional information or have any questions, I'de be more than happy to answer them. Thanks in advance, /jcarver |
|
|
|
|