Article ID: 173097
Article Last Modified on 1/20/2007
SQLPrepare :
INSERT INTO "dbo"."tblTimeTest" VALUES (?)
SQLBindParam:
12:35:00
Microsoft SQL Server then converts the value 12:35:00 to the following:
1899-12-30 12:35:00.00When you run a query in which the Criteria row for the Time field contains a literal value such as #12:35:00 PM# against this linked table, the SQL Server ODBC driver sends the following command to the SQL Server:
SQLExecDirect:
SELECT "dbo"."tblTimeTest"."TimeTest" FROM "dbo"."tblTimeTest" WHERE _
("TimeField" = {t '12:35:00'})
Field: TimeField Criteria: [Enter Time]For more information about the query-by-form technique, please see the following article in the Microsoft Knowledge Base:
95931 ACC: How to use the Query-by-Form (QBF) Technique
Expr1: CVDate(Format([<Name of Time Field>],"hh:nn:ss AM/PM"))NOTE: If you are using Microsoft Access version 2.0, be sure to type the alias Expr1: along with the rest of the expression to avoid receiving a syntax error message.
create table tblTimeTest (ID int, TimeField datetime)
go
create unique index tblTimeTest_ndx on tblTimeTest (ID)
ID TimeField
-- ----------
1 12:35:00
Query: qryTest
-------------------------
Type: Select Query
Field: ID
Table: dbo_tblTimeTest
Field: TimeField
Table: dbo_tblTimeTest
Criteria: #12:35:00#
Additional query words: linking attaching
Keywords: kbbug kbinterop KB173097