If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Help with Filter

Started by nicer, 10 Nov 2014 02:49:46 AM

Previous topic - Next topic

nicer

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)

kc9400

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.
When life gives you lemons, throw them at someone.

nicer