Hi Borislav,
(Priority is the column name for code)
Here is what i have. DECLARE @dBegin datetime, @dEnd datetime
SET @dBegin = '20120101'
SET @dEnd = '20120831'
SET DATEFIRST 1
SELECT r.StartWeek,
tst.Priority,
tst.CodeOccurancesWithinWeek
FROM (select DISTINCT...
Hi Bborisov,
I tried your solution and got:
Msg 245, Level 16, State 1, Line 7Conversion failed when converting the varchar value '2001-11-22' to data type int.
The date itself is taken right from the my table. I only took a sample of the table to show the type of data.
GRP
I guess i must not have been clear enough. Ihave manged to come up witha solution Except it includes any of the dates for the previous sunday with the following weeks data.(I have set it to get the data for a complete year from the present time. I also changed the column name to RecvdDate...
I am trying to create a query which will take data from a table that has a date field, code field, reference Number field. Sample table:
reference Code Date
00856147 1 2012-01-03
00856165 1 2012-01-03
00856240 1 2012-01-03
00856338 1 2012-01-03
00856666 2 2012-01-04
00857499 2 2012-01-09...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.