473,387 Members | 3,033 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.

I get the error message "Data type mismatch in criteria expression" when running the coding(bold). So i am not sure what is going wrong. Thanks for helping.


Expand|Select|Wrap|Line Numbers
  1. Select Case (cbMonth.Text)
  2.             Case "January"
  3.  
  4.                 Dates = "1"
  5.  
  6.             Case "February"
  7.  
  8.                 Dates = "2"
  9.  
  10.             Case "March"
  11.  
  12.                 Dates = "3"
  13.  
  14.             Case "April"
  15.  
  16.                 Dates = "4"
  17.  
  18.             Case "May"
  19.  
  20.                 Dates = "5"
  21.  
  22.             Case "June"
  23.  
  24.                 Dates = "6"
  25.  
  26.             Case "July"
  27.  
  28.                 Dates = "7"
  29.  
  30.             Case "August"
  31.  
  32.                 Dates = "8"
  33.  
  34.             Case "September"
  35.  
  36.                 Dates = "9"
  37.  
  38.             Case "October"
  39.  
  40.                 Dates = "10"
  41.             Case "November"
  42.  
  43.                 Dates = "11"
  44.  
  45.             Case "December"
  46.  
  47.                 Dates = "12"
  48.  
  49.         End Select
  50.  
  51.  
  52.         con3.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = C:\Documents and Settings\LICHIN\Desktop\mys\YS.mdb"
  53.  
  54.         con3.Open()
  55.         ds3.Clear()
  56.         sql3 = "SELECT * FROM sumPercent WHERE dates = " & cbMonth.Text & " AND Year(dates) = " & cbYear.Text & " AND plants = '" & yieldsummary.cbPlant.Text & "'"
  57.  
  58.         da3 = New OleDb.OleDbDataAdapter(sql3, con3)
  59.         da3.Fill(ds3, "sumPercent")
  60.         con3.Close()
Aug 31 '09 #1
0 1476

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...
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: 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....
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....
5
by: blackburnj55 | last post by:
Hi, I am constructing a website for a bike shop. I am using dreamweaver and an access database to create it. I have made a query where two criteria are entered to get results. These are :...
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: Bobby Edward | last post by:
Using Access db with VS2008 (ASP.NET/VB.NET).... On the INSERT command I get this error: System.Data.OleDb.OleDbException: Data type mismatch in criteria expression. I haven't found a...
9
by: nixonmg | last post by:
When the Command Button "Notify" is clicked, I am wanting to send out an email to the user with appropriate information in the email (works great), check the "Notified" check box (does not work), and...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.