July 14, 2017 at 10:27 am
Hello everyone!
I'm hoping you all could help me with an issue....
I have a report with 3 parameters: DateFunction
StartDate
EndDate
The DateFunction parameter retrieves values from a small table in a sql database:
Key Datetype
1 LastWeek
2 ThisWeek
3 LastMonth
etc....
So, want i want to do is have the user be able to select an option from the DateFunction parameter. The parameter will automatically send the key to a stored procedure that will figure out what calculations to do based on the key. I am assuming that I will have to call a function from the stored procedure since I need to return 2 values. Then I need the StartDate and EndDate parameters to automatically be populated with the values.
I hope I explained it good enough. If someone already has a function that does this, it would be greatly appreciated if you could upload it for me.
thanks for all your help!
July 28, 2017 at 1:01 pm
To be honest, that table doesn't do enough for you to waste your time using it. You should probably create an inline table-valued function to completely replace that table. All the different date calculations can take place within the function, and the parameter to the function could either be the key you use currently or the other value in that table. The internals of the function could handle either method.
Steve (aka sgmunson) 🙂 🙂 🙂
Rent Servers for Income (picks and shovels strategy)
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply