L
Lakeuk
I have the following tables setup in Access 97:-
timing table:-
fields-timing_id,f_date,f_time
values-1,25/12/2003,10pm
values-2,26/12/2003,10pm
venue table:-
fields-pos_id,row,seat,x,y
values-1,A,1,1,0
values-2,A,1,2,0
values-3,B,1,1,1
values-4,B,1,2,1
available table:-
fields-av_id,timing_id,venue_id
values-1,1,2
values-2,2,3
When a ticket is sold the details are placed in the available table, the
above shows two tickets sold one for each date, I want to run a query that
will give the following results so I can create a plan of whats sold and
still available:-
example for date 25/12/2003,10pm
fields-av_id,row,seat,x,y
values-null,A,1,1,0
values-1,A,1,2,0
values-null,B,1,1,1
values-null,B,1,2,1
The best query I've comeup with is the following:-
SELECT venue.row,
venue.seat,
venue.x,
venue.y,
available.av_id
FROM venue LEFT JOIN available
ON venue.venue_id = available.venue_id
WHERE timing_id = 1
OR timing_id Is Null;
which would give the following results:-
example for date 25/12/2003,10pm
fields-av_id,row,seat,x,y
values-null,A,1,1,0
values-2,A,1,2,0
values-null,B,1,2,1
Note that the 3rd record from the 1st example doesn't show above which I
would like it to as it is an unsold ticket for the first date.
Any ideas on how to do it, is it possible with one query.
Thanks
Dave
timing table:-
fields-timing_id,f_date,f_time
values-1,25/12/2003,10pm
values-2,26/12/2003,10pm
venue table:-
fields-pos_id,row,seat,x,y
values-1,A,1,1,0
values-2,A,1,2,0
values-3,B,1,1,1
values-4,B,1,2,1
available table:-
fields-av_id,timing_id,venue_id
values-1,1,2
values-2,2,3
When a ticket is sold the details are placed in the available table, the
above shows two tickets sold one for each date, I want to run a query that
will give the following results so I can create a plan of whats sold and
still available:-
example for date 25/12/2003,10pm
fields-av_id,row,seat,x,y
values-null,A,1,1,0
values-1,A,1,2,0
values-null,B,1,1,1
values-null,B,1,2,1
The best query I've comeup with is the following:-
SELECT venue.row,
venue.seat,
venue.x,
venue.y,
available.av_id
FROM venue LEFT JOIN available
ON venue.venue_id = available.venue_id
WHERE timing_id = 1
OR timing_id Is Null;
which would give the following results:-
example for date 25/12/2003,10pm
fields-av_id,row,seat,x,y
values-null,A,1,1,0
values-2,A,1,2,0
values-null,B,1,2,1
Note that the 3rd record from the 1st example doesn't show above which I
would like it to as it is an unsold ticket for the first date.
Any ideas on how to do it, is it possible with one query.
Thanks
Dave