Good aft peeps,
i have a a working solution for this already but i suppose you could say it is a bit lazy,
I have used ADezii's calendar to display dates in my own unique way using the following SQL (using dynamic parameters of course)
what i would like to do is exclude dates which reside in a second table
i tried the following SQL and some variations i could think of as so:
so the second table is the one called tblBlockBookD and holds bank holidays basically, so i dont need them in the query. my lazy man way was to simply strip off the results from the particular text box and add "bank holiday".
please tel me if i am thinking too much about this, i just want something simple, i thought it would be but apparently not.
thanks,
Dan
i have a a working solution for this already but i suppose you could say it is a bit lazy,
I have used ADezii's calendar to display dates in my own unique way using the following SQL (using dynamic parameters of course)
Code:
SELECT tblStaff.StaffID, tblStaff.[Forename] & ' ' & [Surname] AS Name, tbl_Holidays.Date FROM tblStaff INNER JOIN tbl_Holidays ON tblStaff.StaffID = tbl_Holidays.StaffID WHERE (((tbl_Holidays.Date) Between #4/1/2009# And #5/1/2009#-1)) GROUP BY tblStaff.StaffID, tblStaff.[Forename] & ' ' & [Surname], tbl_Holidays.Date, tblStaff.Department, tbl_Holidays.MinutesUsed, tbl_Holidays.Accepted, tbl_Holidays.AuthON, tbl_Holidays.CancON, tblStaff.Surname HAVING (((tblStaff.Department)="Haematology") AND ((tbl_Holidays.MinutesUsed)>0) AND ((tbl_Holidays.Accepted)=True) AND ((tbl_Holidays.AuthON) Is Not Null) AND ((tbl_Holidays.CancON) Is Null)) ORDER BY tbl_Holidays.Date, tblStaff.Surname;
i tried the following SQL and some variations i could think of as so:
Code:
SELECT tblStaff.StaffID, tblStaff.[Forename] & ' ' & [Surname] AS Name, tbl_Holidays.Date FROM tblBlockBookD INNER JOIN (tblStaff INNER JOIN tbl_Holidays ON tblStaff.StaffID = tbl_Holidays.StaffID) ON tblBlockBookD.Date = tbl_Holidays.Date WHERE (((tbl_Holidays.Date) Between #4/1/2009# And #5/1/2009#-1) AND ((tblBlockBookD.Date) Is Null)) GROUP BY tblStaff.StaffID, tblStaff.[Forename] & ' ' & [Surname], tbl_Holidays.Date, tblStaff.Department, tbl_Holidays.MinutesUsed, tbl_Holidays.Accepted, tbl_Holidays.AuthON, tbl_Holidays.CancON, tblStaff.Surname HAVING (((tblStaff.Department)="Haematology") AND ((tbl_Holidays.MinutesUsed)>0) AND ((tbl_Holidays.Accepted)=True) AND ((tbl_Holidays.AuthON) Is Not Null) AND ((tbl_Holidays.CancON) Is Null)) ORDER BY tbl_Holidays.Date, tblStaff.Surname;
please tel me if i am thinking too much about this, i just want something simple, i thought it would be but apparently not.
thanks,
Dan
Comment