Hello I'm currently writing a report based on weekly sales, I've attained my current figure correctly and that works with my @FirstdayofWeek and @LastDayOfWeek parameters and im now trying to replicate it for my Previous week, as you know previous week is -7 days behind
when I run it with this in my where clause
and FirstDayOfWeek = dateadd(day,-7,'2014/06/02')
and LastDayOfWeek = dateadd(day,-7,'2014/06/08')
it works and i get this figure for pre quantity and its correct
BUT when I do this for my parameter
AND dateadd(day,-7,w.FirstDayOfWeek) in (
SELECT Item
FROM DataWarehouse.dbo.ufnSplit(@FirstDayOfWeek, ',')
)
AND dateadd(day,-7,w.LastDayOfWeek) in (
SELECT Item
FROM DataWarehouse.dbo.ufnSplit(@LastDayOfWeek, ',')
)
I get the column headers nothing anywhere. any ideas?
Here is the code I am using to execute the stored proc:
exec WeeklySalesAndUSW @BD=N'798664',
@CGNo=N'47',
@SCGNo=N'01,02,03,04,05,06,07,08',
@ProductClass=N'1',
@ProductCode=N'1108',
@Region=N'772',
@FirstDayOfWeek = '2014/06/02',
@LastDayOfWeek = '2014/06/08'
Why isnt my parameter passing this through? why does it work if I hard code the date in but when i make it dynamic it gets nothing?