Hi
Maybe you can help me with this. Maybe it isn't the right Forum, but I have a report built in CR, which works fine, but I have to base it on a stored procedure. I wrote in Microsoft SQL Server my question, as well.
SQL Server Management Studio Express
I need to write a stored procedure, which has the same result as in Crystal Reports XI.
In Crystal Reports is like that:
@record selection
…..
and ({@Year}={?Year} or {@year}=({?Year}-1))
and date({@dep arr})<date(year(currentdate),month(currentdate),1)
where the formulas are:
@dep arr
if {M.MType} ="Import" then {M.ArrivalDate}
else if {M.MType} ="Export" then {M.DepartureDate}
@Year
if {M.MType} ="Import" then {%yeararr}
else if {M.MType} ="Export" then {%yeardep}
%yeararr
year("M"."ArrivalDate")
%yeardep
year("M"."DepartureDate")
Maybe you can help me with this. Maybe it isn't the right Forum, but I have a report built in CR, which works fine, but I have to base it on a stored procedure. I wrote in Microsoft SQL Server my question, as well.
SQL Server Management Studio Express
I need to write a stored procedure, which has the same result as in Crystal Reports XI.
In Crystal Reports is like that:
@record selection
…..
and ({@Year}={?Year} or {@year}=({?Year}-1))
and date({@dep arr})<date(year(currentdate),month(currentdate),1)
where the formulas are:
@dep arr
if {M.MType} ="Import" then {M.ArrivalDate}
else if {M.MType} ="Export" then {M.DepartureDate}
@Year
if {M.MType} ="Import" then {%yeararr}
else if {M.MType} ="Export" then {%yeardep}
%yeararr
year("M"."ArrivalDate")
%yeardep
year("M"."DepartureDate")