I have this SQL - I want to change the dates so the report will run between 30/10 – 10/11/14 instead of yesterday
where do I need to insert the lines ?
Thank you
-- Filter on Projects completed yesterday
and CAST(dbo.F_GetUDFFieldValD(p.projectid, 'ProjectText511') as datetime) >= DATEADD (day, -1, (DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0)))
and CAST(dbo.F_GetUDFFieldValD(p.projectid, 'ProjectText511') as datetime) < DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0)
Quote from: nicer on 10 Nov 2014 02:49:46 AM
I have this SQL - I want to change the dates so the report will run between 30/10 – 10/11/14 instead of yesterday
where do I need to insert the lines ?
Thank you
-- Filter on Projects completed yesterday
and CAST(dbo.F_GetUDFFieldValD(p.projectid, 'ProjectText511') as datetime) >= DATEADD (day, -1, (DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0)))
and CAST(dbo.F_GetUDFFieldValD(p.projectid, 'ProjectText511') as datetime) < DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0)
and CAST(dbo.F_GetUDFFieldValD(p.projectid, 'ProjectText511') as datetime) >= DATEADD (day,
-11, (DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0)))
and CAST(dbo.F_GetUDFFieldValD(p.projectid, 'ProjectText511') as datetime) < DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0)
I think changing that should give you the result you want but if you only want it for one run just remember to change it back. I wouldn't make that change if it's in a production/being used by users environment unless they all want to see it.
thank you