Displaying Date Period of Week (1 Viewer)

Imran Laldin

New member
Local time
Today, 19:39
Joined
Jul 3, 2012
Messages
4
I have a Table in which date wise recordes are entered, I have already created a query in which dates are converted in week.

I required a seperate column that can show the min to max Date of the same week. e.i in Jan-2012, 01-Jan-2012 is my first week, from 02-Jan-2012 to 08-Jan-2012 is my second week, (Week start from Monday to Sunday)

How can I display the Date Period of the Week

Thanks in Advance.

Regards,
 

Imran Laldin

New member
Local time
Today, 19:39
Joined
Jul 3, 2012
Messages
4
Dear All,

I have not received any reply's is ther any mistake / problem in understanding,

I would like to define my question again.

We are entering sale on Daily Basis and Invoice Once a Week, I want to clump my full week data in a single week record. for this I have tried a query with the Datepart("ww",[dte],2) function which gives my week number in output.

now I have to display the date period of the same week, as quoted in my previous question.

Kindly help me if any one knows the solution.

Regards,
 

recyan

Registered User.
Local time
Today, 20:09
Joined
Dec 30, 2011
Messages
180
Just check out if below gives some guidelines :
Code:
SELECT 
	DatePart("ww",[TheDate],2) AS TheWeekNumber, 
	Min(myTable.TheDate) AS MinOfTestDate, 
	Max(myTable.TheDate) AS MaxOfTestDate
FROM 
	myTable
GROUP BY 
	DatePart("ww",[TheDate],2);

Thanks
 

Imran Laldin

New member
Local time
Today, 19:39
Joined
Jul 3, 2012
Messages
4
Dear Recyan,

this is not working giving error as mentioned below:

You tried to executed a query that does not include the specified expression 'DatePart("ww",[Sale_Date],2)' as part of an aggregate function.


:confused:
 

recyan

Registered User.
Local time
Today, 20:09
Joined
Dec 30, 2011
Messages
180
Have you by any chance missed out
Code:
......
GROUP BY 
DatePart("ww",[Sale_Date],2)

Thanks
 

Users who are viewing this thread

Top Bottom