Wednesday, 11 September 2013

Case within Case statement

Case within Case statement

I have to get an instructor approval date from a table called section. If
that table doesn't have the date (null), then I have to get a date from
offering table, and even if that table doesn't have what I am looking for,
then from Term table.
How do I create a case statement to handle that?
so far here's what I have:
SELECT @dInstructApprDate = case when a.InstructorApprovalDate is null
then
select @dInstructApprDate = instructorapprovaldate from
SSS_OfferingAcademicPeriods where
SSS_OfferingRegPeriods.SSS_OfferingsID = @lSSS_OfferingsID
I am not sure why it doesn't like me using select statement within "THEN"
Any help would be appreciated.

No comments:

Post a Comment