SQLTeam.com | Weblogs | Forums

SQL Query singular column date as at today

I have a large section of code

That produces the below output example:

What I want to do is change the output so for Future scheduled value highlighted in the output it would only show the amount from the date the script is run.

example - all amounts would stay the same as they are overall total amounts adding up since the start of the job BUT the Future scheduled value would change depending on when you run the report.

so if you ran it today it is 1000 but tomorrow could be 300 etc etc

I have selected the bits of code that reference this part as below:

DECLARE @futureplanned TABLE(
Jobid INT,
hours MONEY,
sale MONEY)


INSERT INTO @futureplanned
(
    Jobid,
    hours,
    sale
)

Cast(ROUND(isnull(fp.sale,0),0) as INT) [Future scheduled value**],

LEFT JOIN @futureplanned fp on fp.jobid=job.jobid

Is this possible?

All help and advice much appreciated.

hi that information is there ..
please see the link below

from that you can get the Future Scheduled Value
by filter on the Date Script ran from the tables in the link above !!!!!

something like
where Future Scheduled Value Date > Date Script Ran