Solved

adding data from access db to map

Posted on 2014-02-02
7
294 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
  • 3
  • 2
  • 2
7 Comments
 
LVL 109

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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 109

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Creating and Managing Databases with phpMyAdmin in cPanel.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

821 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