Solved

adding data from access db to map

Posted on 2014-02-02
7
291 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Suggested Solutions

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

746 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

13 Experts available now in Live!

Get 1:1 Help Now