Solved

adding data from access db to map

Posted on 2014-02-02
7
298 Views
Last Modified: 2014-03-24
I have a website I am creating as a hobby. I have a database in access 2013 that countains totals of people that left Dover in the uk and the country they are now residing in. How can I add a textfield at the end waypoint with the total for that country from the database.

In the map example the waypoints go from Dover to Spain.

Spain has 6 people in total residing there from Dover:

Country      Number of People
Spain                  6

How do I write the code to add that [number of people] field?

I could migrate the db to mysql if required.
0
Comment
Question by:PeterBaileyUk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 39827891
Please show us the table structure, thanks.
0
 

Author Comment

by:PeterBaileyUk
ID: 39827915
ok see the attached
Capture.PNG
0
 
LVL 29

Expert Comment

by:fibo
ID: 39828097
You presumably want the query that would show the info you want...

I first I understodd you query as "I want to add a column which will hold the number of people that came to this country"... but since number is goind g to change over time you do not want it "hard data".

From your capture it seems that you already have built the query, which in SQL would probably translate as
SELECT TblCountry.country, count(TblNames.AutoID) number
FROM TblCountry
JOIN TblNames
ON TblCountry.ID=TblNames.CountryID
GROUP BY TblCountry.country
ORDER BY number DESC

Open in new window

(you can check that in Acess by asking to display your query in SQL)
0
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 
LVL 110

Expert Comment

by:Ray Paseur
ID: 39828305
Full Disclosure: I have not tested this query.  But I think this would be the MySQL version (note the use of AS in the query string).  If it's not right, it's pretty close :-)

SELECT TblCountry.country AS country, count(TblNames.AutoID) AS number
FROM TblCountry
JOIN TblNames
ON TblCountry.ID=TblNames.CountryID
GROUP BY country
ORDER BY number DESC

Open in new window

0
 

Author Comment

by:PeterBaileyUk
ID: 39828919
ok so as I understand it once I migrate the data to mysql tables it will allow me to extract the data with the new query and add the field in the web page or my case i believe will be a geotag.
0
 
LVL 29

Accepted Solution

by:
fibo earned 500 total points
ID: 39828963
No no... we did not say you SHOULD migrate your data to MySQL.
You can build and run SQL queries with Access. Access'SQL is at times different from "regular MySQL" (eg for *%_) but the SQL query given above will probably work as si or with slight changes into Access.
Within Access, create a new query. By default you will be presented the QBE (Query By Example) scrren which makes easy for you to build 99% of the queries you nééed? Look at the buttion on top left: it allows you to build the query (with QBE) or to run it... but there is a 3rd option there, "SQL" which
- allows you to the the "Access SQL" equivalent of your QBE query
- allows you to type in a "presumably Access" SQL query which you can then run; in most situations you will also be able to display the QBE version of this SQL text, but in some cases this will not be possible althought the query is correct and runs fine (QBE does not cover the full SQL space)
0
 

Author Comment

by:PeterBaileyUk
ID: 39843759
I already had created the query, just wanted to know how I get the data from query into my wordpress blog.

SELECT TblCountry.Country, Count(TblNames.CountryID) AS [Number of People]
FROM TblCountry LEFT JOIN TblNames ON TblCountry.ID = TblNames.CountryID
GROUP BY TblCountry.Country
HAVING (((Count(TblNames.CountryID))>0))
ORDER BY Count(TblNames.CountryID) DESC;

Open in new window

0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question