Hello Everyone,
I am having problems in creating this view.
create view age_group_view as
select cust_id, birthdate = case
where DIFF(year,birthdate,getdate()) <= 18 then 1
where DIFF(year,birthdate,getdate()) between 19 and 24 then 2 from dbo.customer
The problem - case statement cannot be used.
Is there any way i can create a view like this or is there any problem with this view.
Thanks
I am having problems in creating this view.
create view age_group_view as
select cust_id, birthdate = case
where DIFF(year,birthdate,getdate()) <= 18 then 1
where DIFF(year,birthdate,getdate()) between 19 and 24 then 2 from dbo.customer
The problem - case statement cannot be used.
Is there any way i can create a view like this or is there any problem with this view.
Thanks