OZmium Sports Betting and Horse Racing Forums

OZmium Sports Betting and Horse Racing Forums (http://forums.ozmium.com.au/index.php)
-   Horse Race Betting Systems (http://forums.ozmium.com.au/forumdisplay.php?f=10)
-   -   Database help - MS Access (http://forums.ozmium.com.au/showthread.php?t=7944)

Chrome Prince 11th March 2005 11:43 AM

Duritz,

You are correct.

To fix this issue, open up the access query in design mode:

Right click the relationship (join line between the two tables) and select join properties. Then select show ALL records from table race, and only matching records from table horse. That way if there is no matching horse data, Alinghi won't be missing from the query, only the comments field will be blank.

Duritz 11th March 2005 03:50 PM

Thanks - however the query itself is in Exel, using MS Query, rather than in Access.....

lomaca 11th March 2005 07:03 PM

Quote:
Originally Posted by Duritz
Thanks - however the query itself is in Exel, using MS Query, rather than in Access.....


Hi Duritz!
I am sure you cannot use a table link in Access to give the same links in Excel unless you use a query created in Access and then opened in Excel.
Also you have to be careful if you create a link using only the horse's name, it will pick every record with that name regardless of date race num. venue etc.
You really would have to go back and redesign your tables with well defined primary keys, and avoid using the same field names in different tables, it will cause errors because the database engine does not know whether you meant hName in Horses or hName in Form?
It is very easy to get results that are inaccurate.
Also when you query past races you have to be careful that only the form parameters prior to the race date are being used!
Sorry if I confused you, if it doesn't help just forget it.
I use Access extensively but write my own front end applications to access the data.
Cheers!

Duritz 11th March 2005 09:06 PM

Thanks lomaca. In fact, I don't really have a prob with the way my data is returned to excel via my MS Query queries, as when I do the form I WANT every record returned, and I have made the query it runs through in Access sorted in date order, so that when the MS Query accesses the records they are sorted that way. Essentially, I end up with every run of the horse in the database, from most recent back to day dot, which is how I want it.

What I need is this:

To be able to have another table to which I can add other odds and sods about horses, so that I can extract this info also. Say I want to put a general comment about a horse, I need somewhere to put it where it can be retrieved in a query in excel. Or the horse's age, or prizemoney won so far, or what it's favourite colour is - stuff that doesn't come in normal results which are the meat and two veg of keeping the normal "race" DB up to date. This new DB - horse - I would also like to only be allowed to have one line for each horse, and should I want to update the info on a particular field of that horse, how do I do it without eliminating the other info?

Know what I mean?

foxwood 11th March 2005 09:46 PM

Hi Duritz,
I'm a bit puzzled as to why you're not querying your Ms Access tables in directly MS Access. Why use a middleman, Excel?

Duritz 11th March 2005 10:49 PM

'Cos I do the form in excel, so rather than typing in horse's names individually in an access query, I paste them into excel and hit refresh, and it queries all of the runners at once.

Is there a way I can do that in access?

Duritz 11th March 2005 10:50 PM

(I should say, if my methods seem odd, I am self taught on all this DB stuff....)

Chrome Prince 12th March 2005 10:12 AM

Quote:
Originally Posted by Duritz
'Cos I do the form in excel, so rather than typing in horse's names individually in an access query, I paste them into excel and hit refresh, and it queries all of the runners at once.

Is there a way I can do that in access?


Duritz,

That's why I set it up to have a race table and horse table and then a query in access.

What you can do is this:

Import your spreadsheet with race information to the race table.

Now run the access query and export the results into excel.

You now have the race info and corresponding horse comments on the one spreadsheet without using excel queries.

In this particular instance you don't need primary keys either, as you want all comments returned for a particular horse.

Duritz 12th March 2005 10:45 AM

OK I must be missing the point though.

For an upcoming meeting, say Flemington today, how do I get it to query for all the runners running there at once, so that the results returned are the history's of all runners running there today?

Because if I have all my records of all horses etc in the race database and run that query you sent me, won't that just return me all records of all horses in the DB?

Sorry if this is a nuisance.

Chrome Prince 12th March 2005 07:10 PM

Quote:
Originally Posted by Duritz
OK I must be missing the point though.

For an upcoming meeting, say Flemington today, how do I get it to query for all the runners running there at once, so that the results returned are the history's of all runners running there today?

Because if I have all my records of all horses etc in the race database and run that query you sent me, won't that just return me all records of all horses in the DB?

Sorry if this is a nuisance.


Not a nuisance Duritz, not at all.

Just import todays race field into the race table, run the query and it will show all past info and comments for horses running today, but not others not running, that's the purpose of the horse relationship.


All times are GMT +10. The time now is 12:48 AM.

Powered by: vBulletin Version 3.0.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.