Quote:
> I have a VB 4.0 application where i try to make a simple query
> to a table where the key is of type Date. The database is
> an MS Access 2.0 database.
> The Sql statement which I tried first was:
> Dim WantedDate as Date
> SQL = "Select xxxx from Calendar where CalendarDate = " & WantedDate
Access 2 seems to want to be told explicitly that what it's got is a date,
and this information is imparted unto it by surrounding the date with #
characters. Thus what you may find you'll need is:
SQL = "Select xxxx from Calendar where CalendarDate = #" & WantedDate & "#"
Quote:
> Set MyRS = MyDB.OpenRecordset(SQL, dbOpenSnapshot)
> ..
--
Vox (0|+44)1642 216 200 }*|*{ *o|o* }o|o{ Zetland Buildings, Exchange Square
Fax (0|+44)1642 216 201 o o * Middlesbrough, Cleveland. TS1 1DE
"Imitation is the sincerest form of being a thieving bastard." -- somebody else