What is wrong in the following Statement?
Dim mydate As Date
Format(mydate, "m/d/yy")
rs.Open "SELECT * from accounts where date='" & mydate & "';", con, adOpenStatic, adLockOptimistic
It gives the Error "Data type mismatch in citerian expression"
3 2026 QVeen72 1,445
Recognized Expert Top Contributor
Hi,
Wrap Date Conditions with #:
For Access :
rs.Open "SELECT * from accounts where date=#" & mydate & "#", con, adOpenStatic, adLockOptimistic
For Oracle :
rs.Open "SELECT * from accounts where date=To_Date('" & mydate & "','m/d/yy')", con, adOpenStatic, adLockOptimistic
REgards
Veena
Hi,
Wrap Date Conditions with #:
For Access :
rs.Open "SELECT * from accounts where date=#" & mydate & "#", con, adOpenStatic, adLockOptimistic
For Oracle :
rs.Open "SELECT * from accounts where date=To_Date('" & mydate & "','m/d/yy')", con, adOpenStatic, adLockOptimistic
REgards
Veena
ya its working Thanks a Lot
ya its working Thanks a Lot
'm' will reffer Munit of time
only 'MM' or 'M' will only reffer Month of date.
Just check it.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Jack |
last post by:
Hi,
I have posted this problem before. Apprently, the suggestion took care of
the problem. However, still I am getting the above error message.
I am using a session variable to transfer a value...
|
by: igor.barbaric |
last post by:
Hello!
I have created a very simple query like this:
SELECT Tasks.Name, DurationHrs(,) AS
Duration
FROM Tasks INNER JOIN Log ON Tasks.TaskID=Log.TaskID;
The above query works fine....
|
by: Igor Barbaric |
last post by:
Hello!
I have created a very simple query like this:
SELECT Tasks.Name, DurationHrs(,) AS
Duration
FROM Tasks INNER JOIN Log ON Tasks.TaskID=Log.TaskID;
The above query works fine....
|
by: Eric |
last post by:
Why it gives that error. Both tables have same type of number
Data type mismatch
qry = "SELECT tbl_EquipmentChronology.Equipment1 FROM
tbl_EquipmentChronology WHERE...
|
by: bleighfield |
last post by:
Hi everyone
Hope someone can help with this one..
Background:
I work in vehicle fleet, I have built something to 'predict' when a
car/van service is due (it's fairly simple, calculates...
| |
by: isoquin |
last post by:
The below code throws the error: "Data type mismatch in criteria expression"
Searching online didn't seem to offer me a solution.
Public Sub update_by_EDD(myDate As Date, myMR As String)
...
|
by: Kermit |
last post by:
Hi.
Here's the problem.
I use C# application to access MSAccess database.
I want to get id's of all records containing some phrase and order results by date (a field in the table).
here's the...
|
by: martin DH |
last post by:
I would definitely appreciate any help with this problem as soon as possible. Thanks!
I have a report that should display the results of a query based on two tables (tblClient and tblResult,...
|
by: Ferwayne Yalung |
last post by:
How can i fix the error?
Private Sub cmdadd2_Click()
If cmdadd2.Caption = "ADD" Then
cmdadd2.Caption = "SAVE"
cmdedit2.Caption = "CANCEL"
buttons True, False
a = Date
a = Right(a, 4)
...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |