Thread: [Solved] Multiple queries on table
View Single Post
 
Old 09-17-2012, 01:29 AM
jillapass jillapass is offline Windows 7 32bit Office 2007
Novice
 
Join Date: Dec 2011
Posts: 26
jillapass is on a distinguished road
Default

Sorry, wk_com is a date of start of booking.
It wouldn't make much sense to attach the workbook as the data is in an SQL database so all the workbook contains is a list of bookings for a specified week with the client number and carer number, nothing else at all.
So, the select finds the bookings for a week, I then want to find any previous booking for clients that are already in this list, but these are in the same table.


The query I have is:

Code:
SELECT tblBookingsWarehouse.Wk_Com, tblBookingsWarehouse.CarerNo, tblBookingsWarehouse."Client Number"
FROM ch_warehouse.dbo.tblBookingsWarehouse tblBookingsWarehouse
WHERE (tblBookingsWarehouse.Wk_Com=?) AND (tblBookingsWarehouse.Type='Booking')
ORDER BY tblBookingsWarehouse.CarerNo
Reply With Quote