Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Date selection in vb6/Sql7

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-11-16 : 15:13:05
Bob writes "Houston, we have a problem!
Using VB6 to query our SQL7.0 SP2.
This query works:
"Select * from table where Date >=" & DateTime
where table has a date field configured as datetime, and VB6 has a variable DateTime dimensioned as Date.

This query doesn't work:
"Select * from table where Date <=" & DateTime
nor does just <.

There are records in the table that are equal to, greater than,and less than the variable DateTime. Any ideas?

Question 2, same topic.
The successful query listed above only works if the DateTime variable is a whole number, i.e. no time associated with it. Include a time, and it doesn't work again. I need to query the server for specific date ranges which will include a time down to minutes (dont need seconds or milliseconds).
HELP!!!
Thanks"
   

- Advertisement -