L
lynda
My boss asked me to make a crosstab query to count how
many sales note were written in a week by each employee.
He does not want to see column heading looks like w01Jan,
w02Jan. If we use format like w01Jan, w02Jan, sometimes
one week cross two months, the same week will be shown
like w05Jan, w05Feb. It is confusing. He would like to see
the columns heading is first day of the week, for example,
Jul 6, Jul 13, Jul 20, Jul 27 instead of week - month
format. My tables are: tblSalesNotes(noteID, employeeID,
dateNote, Notes), tblemployeeInfo(employeeID,
employeelastname, employeefirstname)
Someone helped me make the crosstab with column heading
format like w01Jan, w02Jan..., can anyone help me to look
it again and change it to column heaidngs is like Jan 6,
Jan 13, Jan 20 format? Note Jan 6, Jan 13 Jan 20 are
Sundays. Thanks!
Best Regards
Lynda
RANSFORM Count(tblsalesnotes.dateNote) AS CountOfdateNote
SELECT [tblemployeeinfo].[employeefirstname] & " " &
[tblemployeeinfo].[employeelastname] AS WrittenBy, Count
(tblsalesnotes.dateNote) AS [Total Notes]
FROM tblemployeeinfo INNER JOIN tblsalesnotes ON
tblemployeeinfo.employeeID = tblsalesnotes.employeeID
WHERE (((Year([dateNote]))=Year(Date()))
GROUP BY [tblemployeeinfo].[employeefirstname] & " " &
[tblemployeeinfo].[employeelastname]
ORDER BY [tblemployeeinfo].[employeefirstname] & " " &
[tblemployeeinfo].[employeelastname]
PIVOT "w" & Format(DatePart("ww",[dateNote]),"00") & Format
([dateNote],"mmm");
many sales note were written in a week by each employee.
He does not want to see column heading looks like w01Jan,
w02Jan. If we use format like w01Jan, w02Jan, sometimes
one week cross two months, the same week will be shown
like w05Jan, w05Feb. It is confusing. He would like to see
the columns heading is first day of the week, for example,
Jul 6, Jul 13, Jul 20, Jul 27 instead of week - month
format. My tables are: tblSalesNotes(noteID, employeeID,
dateNote, Notes), tblemployeeInfo(employeeID,
employeelastname, employeefirstname)
Someone helped me make the crosstab with column heading
format like w01Jan, w02Jan..., can anyone help me to look
it again and change it to column heaidngs is like Jan 6,
Jan 13, Jan 20 format? Note Jan 6, Jan 13 Jan 20 are
Sundays. Thanks!
Best Regards
Lynda
RANSFORM Count(tblsalesnotes.dateNote) AS CountOfdateNote
SELECT [tblemployeeinfo].[employeefirstname] & " " &
[tblemployeeinfo].[employeelastname] AS WrittenBy, Count
(tblsalesnotes.dateNote) AS [Total Notes]
FROM tblemployeeinfo INNER JOIN tblsalesnotes ON
tblemployeeinfo.employeeID = tblsalesnotes.employeeID
WHERE (((Year([dateNote]))=Year(Date()))
GROUP BY [tblemployeeinfo].[employeefirstname] & " " &
[tblemployeeinfo].[employeelastname]
ORDER BY [tblemployeeinfo].[employeefirstname] & " " &
[tblemployeeinfo].[employeelastname]
PIVOT "w" & Format(DatePart("ww",[dateNote]),"00") & Format
([dateNote],"mmm");