Hi:
There is a datetime field in a SQL Server database. Using ADO, I
extract the maximum date as follows:
strSQL = "SELECT MAX([Timestamp]) AS MaxDate FROM " & TableName
which I then execute. I then set a variable to this value:
varMaxDate = objRS.Fields("MaxDate")
and then I use this to set a SQL Statement:
sSQLStatement = "SELECT * FROM " & TableName & " WHERE Timestamp >= '"
& _
varMaxDate & "'"
The problem is, the resulting SQL Statement is a date, not a datetime.
What is the best way to create a SQL Statement that uses a real
datetime. This SQL Statement is to be used in a SQL Server DTS package
as a query against a Sybase database via ODBC (I'm using VB Script in
an ActiveX Script Task). So my goal is to look in the target table (SQL
Server) for the maximum datetime, and then get any records in the
source (Sybase) with a datetime greater than what is in the SQL Server
database.
Thanks,
Kayda