473,387 Members | 1,844 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.

Join Query Syntax Error

the problem now is here

Expand|Select|Wrap|Line Numbers
  1. sqlstring = _
  2.    " SELECT payed2.payroll, payed2.amount, " & _
  3.       "payed2.type, payed2.page,payed1.datee, " & _
  4.       "personal.email, personl.name, " & _
  5.    " FROM  ((payed2 INNER JOIN payed1 " & _
  6.       "ON payed2.page = payed1.page), " & _
  7.       "INNER JOIN personal " & _
  8.          "ON payed2.payroll = personal.payroll)) " & _
  9.    " WHERE payed2.payroll = '" & mpayroll & _
  10.       "' And payed2.Page = " & mpage & "" & _
  11.    " ORDER BY payed2.payroll;"
  12.  
in join operation
May 20 '14 #1
4 1036
jimatqsi
1,271 Expert 1GB
ihere3010,
Error 'data type mismatch' comes from comparing data items that are not the same type, typically comparing a numeric to a string, but it can also be comparing dates to non-dates etc... The compares can happen in a Where string, but also in a JOIN because JOINS are something like WHERE clauses in disguise. So if you try to join table Personal to table Payed2 on the field 'payroll' in both tables, and payroll is numeric in one table and not numeric in the other table, you'll get that type of error.

So I'm going to guess that either
payed2.page is not the same data type as payed1.page (payed2.page = payed1.page in JOIN)
or
payed2.payroll is not the same data type as personal.payroll (payed2.payroll = personal.payroll in Inner Join)
or
payed2.payroll is not a string (payed2.payroll = '" & mpayroll & "' in WHERE clause, the quotes indicate you're comparing strings)
or
payed2.Page = " & mpage & "" ... OOPS what's that, looks like an extra " at the end of your Where clause

Looks like you were going for a numeric compare.
payed2.Page = " & mpage looks like a numeric compare because there's no ' before you concatenate the mpage variable

We don't know your table/column definitions so we can only guess what you meant. Pay close attention to column data types.

Jim
May 20 '14 #2
all fields joined in tables are matched but I still have problem in select syntax
May 20 '14 #3
I think we are talk about the code as a whole I get it partially solved step by step now by your right recommendations and I need to complete it till end
thanks million
May 20 '14 #4
zmbd
5,501 Expert Mod 4TB
This thread was split from a split thread here: http://bytes.com/topic/access/answer...ria-expression

Please remember that each thread should be limited to one question/topic or very closely related followup questions.

thnx
May 20 '14 #5

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

Similar topics

0
by: Trevor Sather | last post by:
------=_NextPart_000_004D_01C3456C.66EFEC50 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hello The following query used to work when I was using an Access...
0
by: Jonas Gorauskas | last post by:
I am having this one problem on an app I am writing where it shows the following error on some error trapping that I did: Query failed: Error Number: 1064 Description: You have an error in...
4
by: Yaron Avior | last post by:
Hi, I have a question regarding join query syntax: In my DB there are Users table, and Transactions table (which has 'TransactionDate' and 'UserName' fields). I would like to display a list of...
1
by: Dalan | last post by:
I'm experiencing a Query Syntax Error with an Access 97 Db. Actually, the query performs as expected when adding any new records or editing existing ones and even deleting records, EXCEPT when the...
1
by: brainintraining | last post by:
Maybe my eyes are just tired... Can anyone help me spot the syntax error in this code: $sql = "INSERT INTO `images` ( 'imgid' , 'lstid' , 'descrip' ) VALUES ( '', '" ."$pid". "', '' );"; ...
1
by: jomurf | last post by:
Not sure if this is the right forum. I'm using Microsoft Query to get data from our ERP. However, every time I try to sum a column, I get a syntax error. Here's the sql statement: SELECT...
1
by: mickymtl | last post by:
In an ASP file using vbscript and JET 4.0: In the Access2000 database the date_added field is set as general date. Why does "SELECT * FROM traffic_log WHERE date_added >= " &...
5
by: berio211 | last post by:
"I keep getting the following error when I try to modify a query: Syntax error (missing operator) in query expression 'ADPINTER.'. when this happens the qyuery can no longer be seen in design view it...
1
by: shawnjerome | last post by:
I am attempting to combine 2 crosstab queries and I keep getting the "Syntax error in TRANSFORM statement". TRANSFORM Sum(tblPlanSavings.) AS SumOfPlanSavings SELECT tblPlanSavings.,...
4
by: robprestwood | last post by:
Can some one point out to me the error in this sql statement? SELECT CommTypes.Description FROM CommTypes LEFT JOIN (SELECT * FROM IntroducerBasis WHERE...
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: 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
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...
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
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
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.