Browsed by
Month: October 2009

Returning the Nth weekday in SQL…and in InfoPath

Returning the Nth weekday in SQL…and in InfoPath

Ok, after much research I found a forum that had a posting that demonstrated how to get the Nth chosen weekday of a month using T-SQL. Here’s the code: DECLARE @date datetimeDECLARE @weekday intDECLARE @day datetimeDECLARE @number intDECLARE @WhichOne int SELECT @WhichOne = 2 — Set this to the week you want to grabSELECT @number = 1SELECT @weekday = 0SELECT @date = getDate() — Change to dateadd(month, 1, getDate()) for next month, etc. WHILE @weekday 4 — Change this value…

Read More Read More

Calculating Nth weekday of next month in Excel

Calculating Nth weekday of next month in Excel

I won’t normally post Excel stuff on here, but while researching an XSLT/Javascript function I was determined to get it right in Excel first, so I understood it better, and definitely wanted to document it so I could pull it back up later! In this example, I need to know the second Wednesday of next month, because that’s when server maintenance is every month. But what day is it? Here’s the Excel formula: =DATE(YEAR(TODAY()),MONTH(TODAY())+1,1+7*2)-WEEKDAY(DATE(YEAR(TODAY(),MONTH(TODAY())+1,8-4)) Notice the DAY argument of the…

Read More Read More

InfoPath data validation using regular expressions

InfoPath data validation using regular expressions

I found it interesting yesterday, while building an InfoPath template for SharePoint 2007, that you can use regular expression code to perform data validation the same way it’s used in an ASP.Net form, and the same way it’s done in C#. Here’s an example: In my form, I wanted to make sure the data entered conformed to a specific email address format. Normally, an email address pattern looks like this: w+([-+.’]w+)*@w+([-.]w+)*.w+([-.]w+)* This won’t work in InfoPath, there are too many…

Read More Read More

Complete TFS 2008 Install Guide

Complete TFS 2008 Install Guide

I wanted to use Team Foundation Server 2008 as our development solution for our company, and I had never used it before, so I thought I’d give it a whirl on a VM dev box and see how it goes. I tried opening the Installation Guide, and it didn’t work. I tried opening the one online, and it forced me to download a copy that also didn’t work. So, flying blind I gave it my best shot. After over a…

Read More Read More

WSS 2.0 error when adding new users to a site

WSS 2.0 error when adding new users to a site

Yeah, I know, they’re still running WSS 2.0. I’m just here to help, not judge. = ) So I get the request (and I got it before and forgot how I did it) from a site admin that they can’t add a user to their new website they created. It says they already exist when clearly they do not in the Manage Users screen. This is generally because the SID of the existing user account doesn’t match the SID of…

Read More Read More