Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sven2
Yak Posting Veteran
57 Posts |
Posted - 2009-12-11 : 06:32:28
|
| Hello,How can I add the AS statement to a SQL?For example:Select [Print ?] = Case employee.[print ?] WHEN 1 THEN 'X' ELSE '' ENDis working ... but this isn't (no records are displayed anymore)Select [Print ?] = Case employee.[print ?] WHEN 1 THEN 'X' ELSE '' END AS PrintingBest regards,Sven. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-12-11 : 06:43:20
|
| Select Case employee.[print ?] WHEN 1 THEN 'X' ELSE '' END AS PrintingMadhivananFailing to plan is Planning to fail |
 |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2009-12-11 : 08:29:25
|
| And the reason for the error is that both [Print ?] = and AS Printing are treated as alias, thus you have two alias for the same column in your query.- Lumbagohttp://xkcd.com/327/ |
 |
|
|
sven2
Yak Posting Veteran
57 Posts |
Posted - 2009-12-11 : 12:56:29
|
| thanks.works great and thanks for explaining the error.Sven. |
 |
|
|
|
|
|