thanks guelphdad - nearly there
but i need it to only display mot.dayid that equal 1 and mot.bayid = 1
it lists all mottimes regardless of bayid and dayid.
but it is better - didnt know you could leave out WHERE
does that make sense?
this sql lists the data as i would like
except it shows all entries in table book
i would like it to only show records in table book that have the date i specify - but at the same time list all times that are in mott
[code]
SELECT mot.mott, mot.motslot, book.bookdate, mot.bayid
FROM mottimes...
thanks for your reply...
Time Booking
9:00 Free
10:00 Mr Johnson - HJ55JRX
11:00 Free
12:00 Free
13:15 Mrs Smith - HJ06TGY
the ones that say Free will be links to a page to add a record/the ones that are booked will link to page to change details
tables
book
bookid...
have changed the sql to this
motsql1 = "SELECT mot.mott, mot.motslot, car.reg, book.bookdate, cus.fname, cus.lname, cus.pcode, cus.cusid, mot.bayid "_
& "FROM book "_
& "LEFT JOIN mottimes AS mot ON mot.motid = book.slotid "_
& "INNER JOIN car ON car.carid = book.carid "_
& "INNER JOIN cus ON...
hi,
have the following mysql tables
book
bookid slotid date carid
1 1 20060602 1
1 2 20060602... 3
mottimes
id mott slotid
1 9:00 1
2 10:00 2
3 11:00 3
am making a query that lists All mot times in a table
and puts the car...
hi guelphdad - thanks for your reply
you are quite right i have mis-typed the dates as stored in the table in date format.
they do need to be in the format yyyymmdd for the query.
the other thing is what you said bout where clause turning outer join into an inner join
motsql1 = "SELECT...
thanks tony,
this table lists all mot times in a day
mottimes
id mott slotid
1 9:00 1
2 10:00 2
3 11:00 3...
& "FROM mottimes AS mot "_
& "LEFT JOIN book ON mot.motslot = book.slotid "_
& "WHERE dayid =1 AND bayid =1"
there are left joins so that if there is no booking the
times...
thanks for your answers,
i am using asp to produce the page.
even if there are no bookings for book.bookdate then i still want to list all mott - but if there are no bookings for this date then nothing is listed.
also do you know a function that changes the standard date format to yyyymmdd?
hi,
have the following tables
book
bookid slotid date carid
1 1 2006/06/02 1
1 2 2006/06/02... 3
mottimes
id mott slotid
1 9:00 1
2 10:00 2
3 11:00 3
am making a query that lists All mot times in a table
and puts the car...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.