parpaa
asked on
select query
Hi all,
Please find my attached select query, I am trying to use case statements in the select query to create new columns. Please correct my query.
Thanks in advance
parpaa
Please find my attached select query, I am trying to use case statements in the select query to create new columns. Please correct my query.
Thanks in advance
parpaa
select acno, datediff(dd,dateadd(dd,-19,[duedate]),getdate()) as deli,'over due'=case when
datediff(dd,dateadd(dd,-19,[duedate]),getdate())>19 then 'YES' else 'NO'
end ,'service line'= case when[subs]='*ISDN'then 'PRI' else '-' end,
'PRI'= case when
(case when[subs]='*ISDN'then 'PRI' else '-' end)
then 1 else 0
end
into t1 from tabel
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER