Re: MS Access database SQL statement problem
From: Chris Barber (chris_at_blue-canoe.co.uk.NOSPAM)
Date: 10/13/04
- Next message: Chris Barber: "Re: Saving RTB content to SQL Server"
- Previous message: Chris Barber: "Re: sql query ...wrong? in vb.net - please help"
- In reply to: sympatico: "MS Access database SQL statement problem"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Chris Barber: "Re: Saving RTB content to SQL Server"
- Previous message: Chris Barber: "Re: sql query ...wrong? in vb.net - please help"
- In reply to: sympatico: "MS Access database SQL statement problem"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|