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

Translating Access SQL queries into MySQL subqueries.

3
I have a query in Access that uses a subquery, I would like some help on translating it into SQL as a subquery so I can use it in an application.

the queries in Access are
the subquery... (query4)
SELECT Movement.DateTime, Movement.StudentID, Movement.Subject, Movement.Teacher, Movement.Destination, Movement.Lesson
FROM Movement
WHERE (((Movement.DateTime) Between #6/15/2007 7:0:0# And #6/15/2007 19:0:0#) AND ((Movement.Destination)="Away" Or (Movement.Destination)="sign out" Or (Movement.Destination)="sign in") AND ((Movement.Lesson)=3)) OR (((Movement.DateTime) Between #6/15/2007 7:0:0# And #6/15/2007 19:0:0#) AND ((Movement.Destination)="sign in"));


the main query...
SELECT NStudTT.Student, NStudTT.Day, NStudTT.Lesson, NStudTT.Subject, Query4.DateTime, Query4.Subject, Query4.Teacher, Query4.Destination, Query4.Lesson, NStudTT.StudentID
FROM Query4 RIGHT JOIN NStudTT ON Query4.StudentID=NStudTT.StudentID
WHERE (((NStudTT.Day)=5) AND ((NStudTT.Lesson)=3) AND ((NStudTT.Subject) Like "stu*"));


thank you
Jun 15 '07 #1
3 1434
Atli
5,058 Expert 4TB
Hi.

First of all you will have to replace all double quote marks ("..") with single quote marks ('..'), MySQL does not use double quote marks.

You will also have to replace the values you use in you BETWEEN statements. Take a look at the Date Functions in the MySQL Refrence Manual, specificly the Maketime function
Jun 15 '07 #2
Atli
5,058 Expert 4TB
I've edited the thread's title to better describe it's contents.
Please read the Posting Guidlines before posting

Moderator
Jun 15 '07 #3
timn
3
Ta

How do you combine the two queries into one SQL statement in SQL?

Cheers



Hi.

First of all you will have to replace all double quote marks ("..") with single quote marks ('..'), MySQL does not use double quote marks.

You will also have to replace the values you use in you BETWEEN statements. Take a look at the Date Functions in the MySQL Refrence Manual, specificly the Maketime function
Jun 17 '07 #4

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

Similar topics

5
by: Nick | last post by:
Im moving a development app (MySQL 5.0) to a different server which runs MySQL 4.0.20-standard. I am getting errors on queries that have subqueries such as... SELECT id FROM table1 WHERE id IN...
2
by: The Plankmeister | last post by:
Hi, I am converting some queries from stored procedures in MS Access to MySQL, and have hit my first problem. The Access query references another stored procedure, which is where the problem...
1
by: Ninjaboy | last post by:
I'm trying to run NOT EXISTS or NOT IN query to find out wich records in one table do not match the other and mysql just gives me weird error. QUERY: SELECT cust_id FROM customers WHERE...
6
by: Jegger | last post by:
Hello! We have following situation; network with 100 users, aplication developed in Access, user DB deployed on SQL Server. Is it better to create query inside aplication (with code) and then...
1
by: com | last post by:
Extreme Web Reports 2005 - Soft30.com The wizard scans the specified MS Access database and records information such as report names, parameters and subqueries. ......
4
by: Bob Alston | last post by:
Some more, rather specific Access performance questions. IN a split front-end & back-end Access/Jet ONLY LAN situation, and with all query criteria fields and join fields indexed: 1. Is is...
5
by: mathieu.page | last post by:
Hi, I often have recursives queries in my applications, like in this simplified example : req1 : SELECT EmployeNo, EmployeName, EmployePhone FROM Employe; req2 :
10
by: Hank | last post by:
We have just recently migrated the data from our Access 2000 backend to Postgres. All forms and reports seem to run correctly but, in many cases, very slowly. We do not want to switch over until...
1
by: timn | last post by:
Translating Access SQL queries into SQL subqueries. -------------------------------------------------------------------------------- I have a query in Access that uses a subquery, I would like...
0
MMcCarthy
by: MMcCarthy | last post by:
Rather than using the Access design view change the view to SQL. I am going to attempt to outline the general syntax used for SQL queries in Access. Angle brackets <> are used in place of some...
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
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: 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
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...
0
tracyyun
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 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.