473,386 Members | 1,764 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,386 software developers and data experts.

Getting type mismatch error

I am using access as the front end to a mysql database using linked tables. I have a table called dailytrx that has all the transactions, there are 2 fields that I am concerned with, a date and a time, both are text. the date yyyymmdd and the time HHmm. I need to filter these transactions to a 24 hour window starting at 11PM 2 days ago and ended at 11PM yesterday. this is what I tried doing.

SELECT dailytrx.*
FROM dailytrx
WHERE (((DateAdd("n",CInt(Right([TrxTime],2)),DateAdd("h",CInt(Left([TrxTime],2)), DateValue(Right(Left([TrxDate],6),2) & "/" & Right([TrxDate],2) & "/" & Left([TrxDate],4))))) Between DateAdd("h",-1,Date()-1) And DateAdd("h",-1,Date())));


When I try to run it comes back with a type mismatch in criteria. If any one can see the problem I’d appreciate it.
Jul 16 '07 #1
1 1426
ADezii
8,834 Expert 8TB
I am using access as the front end to a mysql database using linked tables. I have a table called dailytrx that has all the transactions, there are 2 fields that I am concerned with, a date and a time, both are text. the date yyyymmdd and the time HHmm. I need to filter these transactions to a 24 hour window starting at 11PM 2 days ago and ended at 11PM yesterday. this is what I tried doing.

SELECT dailytrx.*
FROM dailytrx
WHERE (((DateAdd("n",CInt(Right([TrxTime],2)),DateAdd("h",CInt(Left([TrxTime],2)), DateValue(Right(Left([TrxDate],6),2) & "/" & Right([TrxDate],2) & "/" & Left([TrxDate],4))))) Between DateAdd("h",-1,Date()-1) And DateAdd("h",-1,Date())));


When I try to run it comes back with a type mismatch in criteria. If any one can see the problem I’d appreciate it.
The SQL seems to work fine in Access given the same Text restrictions on both the Date and Time Fields.
Jul 16 '07 #2

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

Similar topics

1
by: LJgrnl | last post by:
I've got a type mismatch error that's driving me nutty. Variable blnNoData has the initial value False. If a recordset comes back empty (both .EOF and ..BOF are true) then blnNoData is set to...
0
by: news.paradise.net.nz | last post by:
I have been developing access databases for over 5 years. I have a large database and I have struck this problem with it before but can find nothing in help or online. Access 2000 I have a query...
6
by: Howard Kaikow | last post by:
I'm doing a VB 6 project in which I am trying to protect against type mismatch errors. Is the process any different in VB .NET? Here's what I'm doing in VB 6. I have an ActiveX DLL. The...
1
by: jodyblau | last post by:
I have a database which works fine until I create and MDE file. Once I create the MDE, when I open a particular form I get a "Type Mismatch" error. Because its an MDE file, I can't step through...
19
by: Steve | last post by:
ASP error number 13 - Type mismatch with SELECT...FOR UPDATE statement I got ASP error number 13 when I use the SELECT...FOR UPDATE statement as below. However, if I use SELECT statement without...
3
by: emmaruwa | last post by:
The following VBA code, in Access 2003, is to make a button open and populate a form based on the Surname and Period_frm data on a previous form. However, i keep getting a type mismatch error...
2
DonRayner
by: DonRayner | last post by:
This one has me stumped. I'm getting a "Type Mismatch" error on one of my forms when it's being opened. It's hapening before the forms "On Open" event, I stuck a msgbox in there to check and I'm...
1
by: nckinfutz | last post by:
hello, I am having a problem with an access database. this is not my database and I did not create it, nor am I very good at access. however, I am a network engineer and that is why this problem...
4
by: imaloner | last post by:
I am posting two threads because I have two different problems, but both have the same background information. Common Background Information: I am trying to rebuild code for a working,...
7
vikas251074
by: vikas251074 | last post by:
I am getting error above in following code since few days giving tension day and night. How can I solve this? I am facing since Oct.25. in line no. 362 After doing a lot of homework, I am...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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.