Using SUM and CASE together
Many people are familiar with the CASE
statement in SQL Server but I do not
see examples of using it like I do so commonly for some of my reporting tasks.
This post assumes the reader has a working knowledge of CASE statements.
New Blog Site!
Warning: This post is outdated. It is here for reference purposes only.
How Will I Know When it Works?
If you are writing code I would assume that you're always writing it for a purpose. Sometimes the purpose is only to experiment or learn but you always have a purpose. You are creating something, solving a problem, or doing something fun. More importantly, your code should have a purpose and a reason to need to be written in the first place.
The first thing you [should] ask is "How will I know that I have solved the problem?" If you don't, how do you know when you're done? Also, what if The Problem was solved but you (or someone else!) just made a change elsewhere in your code base and now your code broke. How would you know? More importantly, WHEN will you know? Will you find the bug before your code goes out the door, or will you have a customer complaint about a bug that should have been discovered months ago?
Right Tool for the Right Job
My dad taught me as a young child that there are different tools that are appropriate for different jobs. Don't use that flat-head on a Philips head screw. Is that a nail? No? Then why the heck are you using a hammer?
As a programmer I find that more than ever, the right tool for the right job is vital for productivity. About two years ago I switched to a MacBook Pro as my main machine and I couldn't be happier. For me, that's one of my "right tools", I love it and I have no plans on switching back. There are occasions where I feel the difference in trying to find a cheap/free tool to get something done where a slew of options are available for PC users, but I can't say it has affected me too much. Throughout a given day I will likely use a huge assortment of tools, below is my list of frequent tools that I use pretty much every single week for various tasks as a programmer.
- NetBeans IDE
- Notepad++
- SourceTree
- Git
- BitBucket
- Microsoft SQL Server Management Studio (SSMS)
- VirtualBox
- Firefox
- Firebug
- Chrome
- Internet Explorer
- Filezilla
- Mantis Bug Tracker
- Trello
- Jenkins
- Phing
- Kompozer
- MySQLWorkbench
Phew, that's 18 different tools, and only a couple (such as Kompozer) don't get used every week. Sure, 3 of them are browsers and it doesn't include iOS Safari, but I have tasks I can only do in IE (shudder), I prefer to use Firefox for web development, and I use Chrome as my searching browser to keep Firefox from having 30 open tabs. This is just a quick list of what I happen to be using at this time, I'm open to suggestions to try as well!
What are your favorite tools for the trade?
"How" is Temporary
Jeff Atwood said "In our field, how only lasts about five years, but why is forever" and I agree. I love learning so much that often I get distracted from a real task with a real deadline because something I saw, read, or thought about interested me at least a bit and I want to know more.
Learning is fun, and in IT related fields, constant learning is a requirement to not being left in the dust. I've gotten to where I am today based on my ability to learn, my ability to take on new challenges, and my ability to say "we should be able to figure something out" and then figure something out.