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 |
X002548
Not Just a Number
15586 Posts |
Posted - 2011-12-16 : 13:04:27
|
converting the mess that some "developers" write in Access against sql server, with nested queries, "Functions" againt columnsFor example Sum(IIf([EMCSdbuser_VwSamplingReport]![Status] In ('ok','fng'),1,0)) AS Clean_EMailI GUESS is a CASE Statement referencing the Status column from the viewand I GUESS that [EMCSdbuser_VwSamplingReport]![Status] is an Access thing?Which should really be, SUM(CASE WHEN d.status_cd IN ('ok','fng') THEN 1 ELSE 0 END) AS Clean_EMailI GUESS?Yes?Brett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxWant to help yourself?http://msdn.microsoft.com/en-us/library/ms130214.aspxhttp://weblogs.sqlteam.com/brettk/http://brettkaiser.blogspot.com/ |
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2011-12-19 : 03:49:24
|
Yes, I guess it is.. |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2011-12-19 : 07:38:44
|
Brett I can empathize! Recently I was asked to make sense of a masterpiece created in Excel with nested IIF's that span multiple sheets with occasional sprinklings of macros and data randomly pulled in from files saved in UNC paths, and so on.I stared at it for half a day, accepted defeat, and reworked it in SQL. |
|
|
|
|
|