Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I am using a stored procedure that uses a case statement...
example:
"SELECT s. [Customer No_],s. [Due Date],s. [Posting Date],'Ageing from Due/Date' =
case
WHEN
DATEDIFF(day,s. [Due Date],@MyDate) <= 30 then '[0 - 30D Days]'..etc"
while I get results using these statements
Let
LOAD [Customer No_],[Due Date],[Posting Date],[Name],[Document No_],[Amount] as Amount,
'Ageing from Due/Date', 'Ageing from Post/date';
SQL
EXEC dbo.cust_ageing @MyDate = '$(MyDate)'; Mydate = Input('Enter date', 'ageing date');I do not see results "categoried" by 'Ageing from Due/Date' ..
is there something special about the CASe statement??
TIA
Few comments:
-Alex
yes...
Let
MyDate = Input('Enter date', 'aging referernce date');SQL EXEC dbo.cust_ageing @MyDate = '$(MyDate)';
if you use arithmetic operators as part of the column names, those need to be escaped in database dependent way. It is easier to use names consisting only of letters, numbers and underscore
can you give me an example? what do you mean "in database dependent way"...?
thanks