Using Multi Select with SSRS and FetchXML in CRM 2011

I have been doing quite a bit of report development lately with SSRS against CRM 2011 online for various client projects.

CRM 2011 online limits you to FetchXML queries only (no SQL!). You can read more about setting up a basic report using FetchXML on TechNet, I’ll assume you already have read that and can handle the basics.

What I’d like to describe is how to make a parameter allow multiple selections. I run into this all the time. Client want’s to pick an employee or all.

In SQL you can use an IN clause, well you can do the same in FetchXML.

There is an “in” operator in FetchXML.

So all you need to do is turn on the “Allow Multiple Values” option in the parameter as shown here.

Select Allow Multiple Values

Then change your FetchXML condition operator from “eq” to “in” as shown below.

The parameter selection will be sent to the query as a comma separated list of values and the proper data will be filtered as expected.

Change FetchXML operator

Good luck!


Running Support

Real quick post, great things happening in the SQL Community around folks supporting each other. It is such a great feeling to conquer anything and Steve is coming up on a major milestone.

Read more on Jes Borlad’s blog linked below and help support Steve Jones as he hits a major milestone, everyone is welcome to join in.

I have committed to 3 myself.

Maybe Next Time

No Nashville for Me

Back on Jan I wrote about recapping my 2010 goals and set forth some new items for 2011. Well the first quarter of the year has come and gone and time to reflect a bit on where I’m at.

First off I had signed up to run the Nashville 1/2 marathon for the 3rd straight year. I’m sad to say that is not going to happen. I did train for it and am ready to run it but a few things have led up to me NOT heading down to run this year. I do plan on a long run this weekend in honor of this and plan on finding a 1/2 more local to get involved with over the summer. I am getting a new master bathroom unexpectedly however and that works starts this week so all is not lost.

I did win my weight loss goal/contest and actually have dropped 15 lbs this year. Feels great and just need to stay focused and keep the weight off at this time.

My involvement in the football program is going well. I’m currently on the board and contributing via helping with maintaining the website, setting up FaceBook, and twitter accounts. I’m also helping out in various other fun projects including merchandising and planning for a great game day experience. Here is a picture of one of my projects that I ran. I’m so excited to get the tunnel out there on opening day and watch the players run out onto the field.

Lake Zurich Flames Tunnel

Can't wait for opening day!

Spending time with the family is always a something that I want to continue to work on. I feel my focus on this and writing it down has allowed me to do so. I find that I’m able to pull myself away from the computer more often than I did last year.  The bills can wait, so there are weeds in the yard, and work is not down that can wait also.. As my kids get older they seem to need me less but I’m still finding things to do with each of them.

  • My youngest Emma (5)  just learned how to ride a bike with no training wells and loves when I watch her. She is really into soccer and baseball this year so that has become our bond.
  • Caleigh (7) still loves her crafts and reading is her big thing. I find myself letting her read to me for 15-20 minutes and not cutting it off at 5 like I used to because Quicken was not update with this months checks.
  • Finally the eldest Matt (10) is quite the gamer on his new PS3. We have had some good battles in Madden but most of all it’s the ability to play catch in the yard that I think we cherish the most.

Can’t forget the wife either. She is the glue keeping us all together and her ability to be in 4 places at once and still remember to pack snacks is amazing. She deserves an entire blog series as her ability to do what she does is mind blowing.

Continuing On

At this point i’m in maintenance mode. Need to keep things moving and identify what’s next but most of all it’s about enjoying the time as it passes and focus less on the end result.

Meme Monday – Backup Fun

Thomas LaRock (blog|twitter) has started Meme Monday and challenged folks to write a blog post in 11 words or less.

Daved Howard (blog|twitter) has tagged me so here it goes.

“SQL Backup you’re killing me, please stop failing, just work please”

Bottom line is I have been working along with the team on getting backups great. Not sure there is such a thing. One of the first things every DBA should be doing but seems to be the hardest to get right. Been working on this quiet a bit lately so it seemed appropriate for this fun blogging tag game.

Dave Levy has been quiet so I’m tagging him.


Be a Hero

Giving Again

Last year around this time I wrote a post about my daughter who cut off her hair to donate it make wigs for cancer patients. The disease has hit my family and friends pretty hard as it has to many people. It’s very interesting to see my kids grasp the concept of service as it relates to helping those that are suffering. My wife and I keep open conversation about tough subjects with our children in hopes that that they grow up to help the community and others as we like to do.

This guy is going to helpsomeone.

Matt's going to jump for Heart!

Well this year my 10 year old son is taking his service to the next level. He will be raising money and jumping rope in the American Heart Associations Jump for Heart program.

Below are the Details

I’m joining millions of other kids to help save lives with the American Heart Association’s Jump Rope For Heart Program!  Will you help me?

I’m doing Jump Rope For Heart at my school and learning about kids with special hearts. I’m also learning about my own heart, and how to take care of it. And I’m getting active and jumping rope!

Some kids have special hearts – and need our help!  I’m raising money to help kids like them. The money I raise will help pay for education and for new medicines and treatments to be discovered.  It could help cure heart disease – for everybody!

You can help too!  Will you make a donation?  It’s fast and easy to do on my personal Web page! Just use the link below.
My Personal Page

Thank you for helping me save lives and be a Heart Hero!


Vista boot Stuck on a black screen with a mouse cursor

I’m not your help desk

Ok so a totally crazy name for a post. Here is the deal. I tend to be the tech support for much of my friends and family. My most recent conquest was one that was very challenging. I figured if it took me a few nights to figure it out and searching on the above got me the answer. It took a lot of reading comments in forums to get the right answer in my case. So I wanted to write a quick post with how I solved it and hopefully help someone out in the future.

So friend calls up and says, Geek Squad wants 130 bucks to upgrade my laptop to Windows 7. Can you do it? As usual I tell them to go to Geek Squad or use this other friendly company I know that does this on a regular basis. Essentially I don’t want to become their IT support for life. But an hour later he calls back and says, now this laptop won’t even boot. It just comes to a black screen with the mouse after I log in to the Vista login screen. Well I had some time that night so I said said drop it off I’ll take a quick look.

The Battle

So I tried the basics you will find if you search “Vista Black Screen Mouse Only” you will get long forums like this with various solutions and things to try. Mostly just people complaining about Microsoft. In any case this particular friend is not very technical so he would never have been able to figure this out.

I finally stumbled upon this thread which led me to the answer. It’s a long read and has lots of different answers but let me summarize.

1) Get to a command prompt using many of the ways described on the net. Pressing F8 on boot, or if you have to power off and on the hard way it should bring up the startup menu with command prompt as an option.

2) Get to C:\Windows\System32 and run MSCONFIG.EXE like shown below.


Here is what to type in

3) This should pop the GUI which you can choose the selective startup options as shown below.

System Configuration Screen

Change to what's highlighted here!

4) Choose Ok and then restart.

Next Steps

At this point I was able to login and get the desktop back. I still assumed other things were wrong so I started cleaning the system with the typical spyware and virus tools. In this case the problem continued to exits so I used the Windows Easy Transfer tool described here to backup all his data. I then installed Windows 7 and recovered his data from the backup.

At this point the response is that his laptop has never worked better.

Hope this helps someone.

Powershell Baby Steps

T-SQL Tuesday

First timer for T-SQL Tuesday so not even sure if I’m doing this right. I was going to write this post at some point but kept putting off. However reading all the great posts today and my passion for automation have driven me to share.

Old Backups
The way we have our SQL backups setup we have a few servers with numerous shares on them. So each servers backups are mapped to a specific share on the backup server(s). Our backup jobs are set to remove backups over x hours old when a new one is created so we should never have bak files over x hours on the backups servers.

In a perfect world we would never have old files but the world is not perfect. The problem starts to occur when servers are decomissioned or files are put in folders for a restore and forgotten. Essentially overtime we end up with 100’s of GB’s worth of old BAK files out on our backups servers. Eventually they get noticed and cleaned up when we get low disk space alerts on our servers or someone stumbles upon an old file. Not a huge problem but there is no reason to have these old files out there so why waste the space.

So one day I was frustrated by the amount of old files out there as I was arguing with someone over needing more disk space for another project. I was having an angry day and started looking through the folders manually one at a time. I decided that was a colossal waste of time so I did some windows searches on files *.BAK that were older than 60 days, etc. After asking Dave Levy (blog | twitter) how to copy out my Windows Explorer search results to excel to share with the team he challenged me to just write a Powershell script to dump to a CSV file.

I don’t get to code much these days in my role so I took the challenge. Well actually Dave sent me a script and I made  2 small changes to it and ran it. Magic! I had a file in seconds that I could send out to the team so they can go clean up the files. I’m sure you POSH experts are saying Duh that’s a no brainer. Keep this in mind, I turned in my coding badge years ago and struggle at times to grasp new coding concepts.

My Script

Get-ChildItem -Path \\YOURBACKUPSERVERNAME\d$\ -recurse -include *.bak | Where-Object {$_.lastwritetime -le ‘1/1/2011’} | Export-Csv OldBackupReport.csv

Within 1 day we re-gained 1TB on our backup server drive and no need to buy more disk!

Can you guess what day I sent out the report?

Look at all that disk we saved!

This could be an automation stretch as I’m pretty much dumping out info to a file to have people go manually delete the files. I could have the script delete them I’m sure but I wanted to make sure we were not removing files that may be in process for a restore. I also considered scheduling this to run monthly and email the team which is something I might do in the future and post about at a later date.