Re: MS Access database SQL statement problem

From: Chris Barber (chris_at_blue-canoe.co.uk.NOSPAM)
Date: 10/13/04


Date: Wed, 13 Oct 2004 02:36:18 +0100

Jet engine (Access generally) requires explicit use of '#' to delimit date strings whilst almost all
other databases will take the string (delimited with single quotes) and cast it to a datetime value
when used against a datetime value field.

So .. don't get caught out when you try datetime values against another databases (not using Jet)!

Chris.

"sympatico" <feedback@a1vbcode.com> wrote in message
news:J6jad.10402$3C6.291046@news20.bellglobal.com...
The code above is relevant but it gives problem when run. I stored
Daily_Rubber_Crop table in MS Access database and set the data type of
date/time but when i retrieve the data it pop up a message "Data type
mismatch in criteria expression". Do anyone know why this probem occur and
the solution for it.

tempDate = Format(Calendar1.Value, "mm/dd/yyyy")

rubber.Open "Select * from Daily_Rubber_Crop where Daily_Crop_Date = '" &
tempDate & "' order by EmpId"

Thank you.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.776 / Virus Database: 523 - Release Date: 12/10/2004


Relevant Pages

  • Re: File/data structure information
    ... databases). ... The applications are for storing/finding strings, ... no extra code, except for the customization routines, and can be ... In that case the extra indexes ...
    (comp.programming)
  • Re: Dates mm/dd/yyyy & dd/mm/yyyy giving a major headache
    ... Unless your dates are held in the DB as strings (in which case you are going ... SQL statements as ISO format: ... 'CAST' for SQL Server and whatever works for alternative databases) them as ...
    (microsoft.public.inetserver.asp.general)
  • Re: saving labview data to a database
    ... If you're unfamiliar with databases, you should first familiarize ... so I always just used "concatenate strings" to build the SQL ...
    (comp.lang.labview)
  • Re: Which database?
    ... but the performance is poor and databases are grossly ... >> libraries and Jet Engine are already installed on a lot of machines, ...
    (comp.lang.pascal.delphi.misc)
  • Re: deployment and database location
    ... >> I have made a vb.net windows app that works great in design. ... > any of the two databases it needs to operate. ... > connection strings to application.startupath, ...
    (microsoft.public.dotnet.languages.vb)