Life, the Universe and the Internet

My ramblings about making a living on the internet and life in general

Archive for September, 2007


Matching Dates On Fields With Different Times In A Transact SQL (SQL Server 2005) Where Clause

Just a quicky little Sql Server tip that I came across the other day.  If you are ever in a situation where you want to compare two dates in a where clause in a Transact SQL statement, but those dates actually have different times, for example:

Date1 =’01/09/2007 01:00:00′
Date2 = ‘01/09/2007 05:00:00′

You can’t just say “Where Date1 = Date2” because the times don’t match, but what you can do is in your where clause first reset both the times slots to midnight then do the where comparison, as per the example below:

SELECT SomeFields FROM SomeTable
WHERE CAST(FLOOR(CAST(Date1 AS FLOAT)) AS DATETIME) = CAST(FLOOR(CAST(Date2 AS FLOAT)) AS DATETIME)

Basically what this does is convert the date to a floating point, the floor command then basically rounds it down to the nearest integer, then it is converted back to a date time, the end result is that the dates now both look like this:

Date1 = “01/09/2007 00:00:00”
Date2 = “01/09/2007 00:00:00”

Hope this will be some use to someone.

Optoma Themescene HD80, My Newest Toy

Optoma Themescene HD80This is a bit off topic for this blog, but I just have to post something about my new toy. As anyone whose read this blog enough will know I’m a bit of a film nut and I have a large screen and projector set up at home to get the full cinema effect.

Recently I’ve upgraded my projector, I didn’t really have any intention of doing it but I got to hear about a new full 1080p projector that had just been released, was getting rave reviews and was incredibly low priced compared to other 1080p models. The projector in question is the new Optoma Themescence HD80 and is available for under £2000. For this price I got the projector, and eight foot screen and a free replacement bulb voucher.

And boy what a projector it is, I was totally blown away with it. I managed to arrange a demo at Sevenoaks Hi-Fi in Bristol. They were demo-ing it with a PS3 and some Blu-Ray disks and it is just incredibly detailed, really bright, rich deep colours and amazingly quiet too. I’m running it with a Xbox 360 and HD-DVD Drive and the Xbox is very cool at this size and detail level.

In terms of value for money, I really think this projector is unbeatable, when you think that much of the competition at this level is up over £6000 or more there really is no beating it. If you’re interested in getting one, I really recommend seeking out a demo, you will love it.