Well that raises a few questions...
See inline:
Can you define "in sql server". What version of SQL Server, and how/where
did you execute the query? Was it via SQL Management Studio or some other
tool?
What error message? How did you "take it to VB.NET"? Are you executing
the query via ADO.NET inside your app?
There's no reason the query should work any differently when executed from
ADO.NET as opposed to inside any of the other SQL tools. The SQL engine
is what's executing that query, not your application or the query tool.
One thing I would recommend is using a more robust way of passing date
values in to the query - if you run your application on machines with
other default locales (such as dd/MM/yyyy) then the query will fail under
some circumstances (if you're lucky) or return confusing results (if
you're not).
-Alex
__________ Information from ESET Smart Security, version of virus
signature database 4478 (20091003) __________
The message was checked by ESET Smart Security.
http://www.eset.com