Rob Farley

Rob Rob Farley has been consulting in IT since completing a Computer Science degree with first class honours in 1997. Before moving to Adelaide, he worked in consultancies in Melbourne and London. He runs the development department in one of Australia's leading IT firms, as well as doing database application consultancy and training. He heads up the Adelaide SQL Server User Group, and holds several Microsoft certifications.

Rob has been involved with Microsoft technologies for most of his career, but has also done significant work with Oracle and Unix systems. His preferred database is SQL Server and his preferred language is C#. Recently he has been involved with Microsoft Learning in the US, creating and reviewing new content for the next generation of Microsoft exams.

Over the years, Rob's clients have included BP Oil, OneLink Transit, Accenture, Avanade, Australian Electorial Commission, the Chartered Institute of Personnel and Development, the Royal Borough of Kingston, Help The Aged, Unisys, Department of Treasury and Finance (Vic), National Mutual, the Bible Society and others.

Did you mean to come here? My blog is now at http://msmvps.com/blogs/robfarley



12 May 2006

Returning the wrong type on purpose

There is a 3rd party application we put scripts into from time to time - it's a pretty good app on the whole, but these scripts have to be VBScript.

Anyway - I pull data out of a database to use in these scripts, and have recently found that I have had to tell my query to return numbers as varchar. The reason? Because when I try to use CLng on the data (which I like to do in non typed languages), it complains that my numbers are bigger than 2 billion. So instead I'm putting more functionality into my query, and doing my subsequent maths there, returning the data as a pre-formatted varchar ready to just get printed out. I feel dirty and have to go home to wash.