**self-hosted org**
My predecessor wrote a script that I am trying to adjust to meet current needs. So the red arrow in the image below points to a line in the script that makes a column of values go to the end of the previous month. That is great when they are running this for a single month, but in some cases, my coworkers run the report across two or more months. The purple arrow in the image points to where I commented out that function and made the date values go to whatever start date is chosen, and that work great too. But how can I make BOTH option available? How can I make it evaluate the date parameters on an If/then basis? Is that even possible when declaring a value?
Thanks,
Ashley Elliott
Database Administrator
St. Louis Symphony Orchestra
314-286-4198
ashleye@slso.org
IF/ELSE can be used for setting values, certainly, as long as the declaration is outside of it. So:
declare @PM_End datetime
if @months > 1
begin
@PM_End = @startdate
end
else begin
@PM_End = dbo.function(@enddate)
Am I reading your question correctly?
I think so... I will try this next week and reply back.
Thank you so much!
Ashley
Omitting and forgetting things in my example, for instance forgot to add the select or set commands...