473,387 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

data type mismatch in criteria expression

Hello Everyone,

Could you help me to find out what is wrong with my query, please? The problem is on the [Date of Change] which is a Date field

Expand|Select|Wrap|Line Numbers
  1. Me.RecordSource = "SELECT tbl_GCDS_Operations_Positions_Fills_Log.* " & _
  2.        "From tbl_GCDS_Operations_Positions_Fills_Log " & _
  3.        "WHERE (((tbl_GCDS_Operations_Positions_Fills_Log.[Date of Change])='" & Me.cboDate.Column(0, Me.cboDate.ListIndex) & "')) " & _
  4.        "ORDER BY tbl_GCDS_Operations_Positions_Fills_Log.[Date of Change];"
  5.     Me.Requery
  6.  
  7.  
Thank you.
Apr 19 '18 #1

✓ answered by twinnyfo

Ivon,

Try changing line 3:

Expand|Select|Wrap|Line Numbers
  1. "WHERE (((tbl_GCDS_Operations_Positions_Fills_Log.[Date of Change])= #" & Me.cboDate.Column(0, Me.cboDate.ListIndex) & "#)) " & _
You had the WHERE statement looking for a text value. The "#" indicate a date is expected.

Hope this hepps!

5 1926
twinnyfo
3,653 Expert Mod 2GB
Ivon,

Try changing line 3:

Expand|Select|Wrap|Line Numbers
  1. "WHERE (((tbl_GCDS_Operations_Positions_Fills_Log.[Date of Change])= #" & Me.cboDate.Column(0, Me.cboDate.ListIndex) & "#)) " & _
You had the WHERE statement looking for a text value. The "#" indicate a date is expected.

Hope this hepps!
Apr 19 '18 #2
You are awesome! Thank you.
Apr 19 '18 #3
twinnyfo
3,653 Expert Mod 2GB
Any time! Glad to be of service!
Apr 19 '18 #4
NeoPa
32,556 Expert Mod 16PB
Don't forget to explain to students that dates should never be used in SQL strings just as they come (See Literal DateTimes and Their Delimiters (#)). It will generally work in the USA, but nowhere else in the world.
Apr 20 '18 #5
twinnyfo
3,653 Expert Mod 2GB
I meant to reference that article, but forgot. Thanks, NeoPa!
Apr 20 '18 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: ArcadeJr | last post by:
Good morning all! I have been getting a Run-time Error message #3464 - Data Type mismatch in criteria expression. While trying to run a query. I have a database where the field Asset_Number...
4
by: N J | last post by:
Hi, CurrentDb.Execute "Update tblDelayedOrders Set DELAYED = True Where ID = " & Me.txtOrderNumber & ";", dbfailonerror Me.StatusListBox.AddItem "ORDER # " & Me.txtOrderNumber & " MARKED AS...
3
by: martlaco1 | last post by:
Trying to fix a query that (I thought) had worked once upon a time, and I keep getting a Data Type Mismatch error whenever I enter any criteria for an expression using a Mid function. Without the...
1
by: amitbadgi | last post by:
I am getting the following error while converting an asp application to asp.net Exception Details: System.Runtime.InteropServices.COMException: Data type mismatch in criteria expression. ...
2
by: technocraze | last post by:
Hi guys, Implementations application & programming environ MS Acess + Visual Basic Table fields Serialno (pk) - Auto number StudentId - text Course - text intake - number
10
by: aaronrm | last post by:
I have a real simple cross-tab query that I am trying to sum on as the action but I am getting the "data type mismatch criteria expression" error. About three queries up the food chain from this...
2
by: psychomad | last post by:
Please, can someone help me out to solve this error, i've been searching throughout my codes and yet i didnt succeed in finding the error!!!! The Error is: Server Error in '/' Application....
19
by: Lysander | last post by:
I have written a query that takes three integers representing day,month and year, forms a date from them and compares this date to the date the record was entered and returns any records where the...
1
by: DC | last post by:
Any idea why this code would cause a error? The SQL that gets executed seems to be (using record 1132 as an example) DELETE FROM user_table WHERE ID = '1132'; And the value of...
2
by: tmoon3 | last post by:
Hello, This must be a simple mistake, but for some reason I cannot seem to get around it. I am simply trying to create a report of all employees that have a date filled in in a training column...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
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...
0
Oralloy
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,...
0
jinu1996
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.