26 Sept 2009

T-SQL Get dates on a specific day when you don't care about time

Quite often I have to write queries to return rows where something happened on a specific day. But the values in the table could be anytime within that day.

Previous I would pass in a start date, end date to do this, but the query then needs 2 parameters and it looks a bit cumbersome.

I came across this method which I now employ. Don't know if this has much performance impact, but it certainly is quicker to code and takes less parameters from calling application.

Where
(
DateDiff(day, @ReportStartDate,TerminalSession.StartDate) = 0

--StartDate >= @ReportStartDate
--And
--EndDate >= @ReportEndDate
)

22 Sept 2009

Visual Studio Dataset Designer Problem

Just wasted about 5 hours on a really annoying problem.
I have a data access layer project in my solution.

It stopped compiling properly and was giving mutliple defintion errors.
The was one dataset.xsd
but mutliple dataset.designer.vb (e.g. dataset.designer1.vb, dataset.designer2.vb).
Somewhere along the line the .vbproj file must have added another entry.

To solve I copied the XSD file to desktop.
Deleted it from project (through IDE).
Deleted all the .designer files (through explorer).
Readded the XSD to the project and it compiles fine.

Actually thats what I should have done, initially I wasted hours and hours trying other solutions.

9 Sept 2009

Code Rush : Refactor

Had tried this out a few years back, and it ate up my CPU/Memory so unistalled it on the day I installed it.

Just downloaded the latest version available on their website

Structural highlighting is my favourite feature to date (even though it isn't much of a time saver)

Have to say no speed/cpu/memory issues now, and the product is SUPERB.
It is going to save me so much time coding I might cut down to a 6 day working week.

7 Sept 2009

New Blog

Hi folks,
Haven't blogged in quite some time, but have decided to start again.
Some stuff on .NET serialization to follow.