how do i get help with querying a database

G

Guest

i have a very large database with information about vehicl maintenance and i
desperately need help to extract information.ie
fleet no1,fitdate1,type1,mileage1
fleetno2,fitdate2,type2,mileage2 etc upto mileage 6
the same vehicel may appear in fleetno1 and fleetno5
these are all in the same record and i need to be able to list on screen the
individual
parts of a record dependenant on fleetno1 or fleetno2 etc being equal to a
certain condition .
its complicated and confusing i know but can anyone help me!!!!!!!
 
J

JohnFol

So to be clear, the table looks something like:

fleet no1
fitdate1
type1
mileage1
fleetno2
fitdate2
type2
mileage2

And you want:

Fleet Number Fleet Date Fleet Type
1 1/1/01 1
2 2/2/02 2

where these 2 rows are from the same record?


1st I'd suggest revisit the table design as this is what's causing the
problem.

2nd, have a look at Union Queries, for example

Select fleet no1, fitdate1, type1, mileage1 From FleetTable
UNION ALL
Select fleet no2, fitdate2, type2, mileage2 From FleetTable

This will give you the multiple rows per record, but you won't be able to
update it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top