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.

 All Forums
 Other Forums
 MS Access
 boy do I hate...

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 columns

For example

Sum(IIf([EMCSdbuser_VwSamplingReport]![Status] In ('ok','fng'),1,0)) AS Clean_EMail

I GUESS is a CASE Statement referencing the Status column from the view

and 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_EMail

I GUESS?

Yes?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://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..
Go to Top of Page

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.
Go to Top of Page
   

- Advertisement -