Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula always returns zero on date parameter

Status
Not open for further replies.

tigerjade

Programmer
Mar 17, 2004
237
US
I've been programming for years, but just started using CR last week, so please forgive me if this turns out to be a 'duh' moment. :)

I have a table that holds sets of data, one per day (populated by a nightly job). The report requests a start date & an end date, and is then s'posed to pull the relevant data for that particular date from the table. The formulas pulling data for the start date are fine; however, I get all zeros for the end date's fields. Here's the formula I'm using:

Code:
if (DateDiff("d",{HistoryMonth.histDate},{?EndDate}) = 0) then {HistoryMonth.histAllMonth10} / 1000

Any idea why I'm getting zeros on this? The data does exist; I see it just fine in the system. The only difference in the start & end date formulas is the parameter name.

tia

tigerjade

"Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live." -- Martin Golding


 
Okay, here goes: I have a job that pulls data from another system, compiles it & inserts it into this table: one row per date. The table contains all ints, and has a value for each of the next 12 months, like this:

histDate datetime
histMonth0 int
histMonth1 int
...

The report requires the two parameters; each parameter should return one row. I need to match up the data from each row in vertical columns:

end start
month0end month0start
month1end month1start
...

Here's the data for 6/7/05:
6/7/2005 4:08:34 AM 5164788 7584209 7892698 4030375 2745445 1507998 1387301 1559397 897931 272697 85719 44305

And for 6/9:
6/9/2005 4:08:32 AM 4798691 7581586 7893086 4062653 2742784 1506706 1399800 1558070 897931 272697 85719 44305

Sometimes it's the same, when you're looking a year out. I'm going to take this data & manipulate it further, but that's the part I'm having trouble with.

Thanks a million, again. :)

tigerjade

"Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live." -- Martin Golding


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top