view all dates between two dates parameters in the crosstab query headings

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #16
    Code:
    PARAMETERS d DateTime, b DateTime; 
    SELECT * FROM (
       TRANSFORM Sum(Vaclist.Period) AS SumOfPeriod 
       SELECT Vaclist.EmpID, Vaclist.Vactype 
       FROM qryEmployeeWorkDates LEFT JOIN Vaclist ON (qryEmployeeWorkDates.EmpID = Vaclist.EmpID) AND (qryEmployeeWorkDates.DateOfPeriod = Vaclist.VacDate) 
       WHERE (((qryEmployeeWorkDates.DateOfPeriod) Between [d] And [b])) 
       GROUP BY Vaclist.EmpID, Vaclist.Vactype 
       PIVOT qryEmployeeWorkDates.DateOfPeriod
    ) t
    WHERE EmpID IS NOT NULL;

    Comment

    • Projectnow
      New Member
      • Oct 2012
      • 13

      #17
      Rabbit, Great!
      you are genius!
      thank you for your assistance and your patience
      I ended with this
      Code:
      PARAMETERS d DateTime, b DateTime;
      SELECT *
      FROM qrycrosstab
      WHERE (((qrycrosstab.EmpID) Is Not Null));
      I really appreciate your help
      thank you again and over again

      Comment

      Working...