Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > CASE SQL construct
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 10th July 05:20
edgar
External User
 
Posts: 1
Default CASE SQL construct



Hello,

I am trying to break one column into multiple columns
based on the content of a key column (I call it a crosstab
report).
I am using a query that works in Query ****yzer but when I
attempt to create a View I get the ERROR:

"The Query Designer does not support the CASE SQL
construct."
(CASE is not supported in SQL Server View)

The query looks like this:

SELECT Container, Product, WorkFlow,
MAX(CASE Operation WHEN 'Litho' THEN InDate END)
AS 'LithoIn',
MAX(CASE Operation WHEN 'Label' THEN OutDate END)
AS 'LabelOut'
FROM
(MAIN QUERY)qryname
GROUP BY Container, Product,WorkFlow

Any input is greatly appreciated
Thankyou
Edgar
  Reply With Quote


  sponsored links


2 10th July 05:20
vishal parkar
External User
 
Posts: 1
Default CASE SQL construct



hi Edgar,

It is recommended that you use SQL Query ****yzer than the Query designer or
enterprise manager. to create/alter view. You can run any valid t-sql statement
within SQL Query ****yzer for all your T-SQL programming constructs

EM manager has some limitations within it.

A sample CREATE VIEW syntax with CASE expression will be as follows.

use northwind
go
create view v1
as
select case customerid when 'alfki' then 'a' else 'b' end as customerid
from customers
go


-- Vishal
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666