Solved

adding data from access db to map

Posted on 2014-02-02
7
293 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 108

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
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.

 
LVL 108

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now