Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date/Week Formatting in Query 1

Status
Not open for further replies.

mbthaz

Technical User
Aug 29, 2002
44
US
I have a query that pulls daily numbers and averages them by week. That query is listed below. What I would like to do is have the date display the day the week started instead of the week number. Any help with this is greatly appreciated.

SELECT (Format([Date],"ww"" '""yy")) AS Expr1, Avg(Deskside_IOC_Rate_qry.InterviewRate) AS AvgOfInterviewRate, Avg(Deskside_IOC_Rate_qry.OfferRate) AS AvgOfOfferRate, Avg(Deskside_IOC_Rate_qry.CloseRate) AS AvgOfCloseRate
FROM Deskside_IOC_Rate_qry
GROUP BY (Format([Date],"ww"" '""yy")), (Year([Date])*CLng(54)+DatePart("ww",[Date],0)-1);



Thanks,

Mike
 
Tacky replying to my own post I know, but I found the answer.


SELECT Min(Deskside_IOC_Rate_qry.Date) AS MinOfDate, Avg(Deskside_IOC_Rate_qry.InterviewRate) AS AvgOfInterviewRate, Avg(Deskside_IOC_Rate_qry.OfferRate) AS AvgOfOfferRate, Avg(Deskside_IOC_Rate_qry.CloseRate) AS AvgOfCloseRate
FROM Deskside_IOC_Rate_qry
GROUP BY (Year([Date])*CLng(54)+DatePart("ww",[Date],0)-1), (Format([Date],"ww"" '""yy"));
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top