I'm trying to create a SQL script that we can pull software items that are less than a certain version. However the Software.Display.Version is stored in varchar and I can't seem to conduct a 'less than' or 'greater than' against the varchar. I've tried conducting a CAST and CONVERT with no luck.

Anyone have an ideal on how to approach this?

Thanks,
Dave
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Yes those are strings because they are definitely not numbers. They contain numbers so I understand the temptation and expectation. However, there is an answer:

regular expressions! A valuable tool in the IT pro's box:

see this for an example: http://itninja.com/question/silent-uninstall-oracle-8-cilent3368&mpage=1&key=regex&#73897

If the version is simple enough you can also use basic sql pattern matching. % is an anylength wildcard and _ is a single character wildcard
Answered 10/12/2011 by: GillySpy
Seventh Degree Black Belt

Please log in to comment
Answer this question or Comment on this question for clarity