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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FORMULA...........

Status
Not open for further replies.

21128

Programmer
Aug 27, 2009
36
US
THIS IS MY QUERY

SELECT max(rev_no), max(tour), max(DT), max(SHIFT_NO), max(DECODE(STA,1,RD,NULL)) "MW PR",
max(DECODE(STA,2,RD,NULL)) "MW",
max(DECODE(STA,3,RD,NULL)) "MW D",
max(DECODE(STA,4,RD,NULL)) "MV PR",
max(DECODE(STA,5,RD,NULL)) "MV",
max(DECODE(STA,6,RD,NULL)) "MV D",
max(DECODE(STA,7,RD,NULL)) "P2300-3 PR",
max(DECODE(STA,8,RD,NULL)) "P2300-3",
max(DECODE(STA,9,RD,NULL)) "P2300-3 D",
max(DECODE(STA,10,RD,NULL)) "P2300-4 PR",
max(DECODE(STA,11,RD,NULL)) "P2300-4",
max(DECODE(STA,12,RD,NULL)) "P2300-4 D"
FROM history WHERE tour=18 AND rev_no=1 AND DT={?SelectDate} GROUP BY SHIFT_NO

HOW CAN I CREATE A FORMULA THAT GIVES ME A VALUE OF "MV" OF THE PREVIOUS DAY'S LAST READING WHICH IS THE MAXIMUM SHIFT_NO?


THANKS
 
Please don't use CAPITALS, it counts as shouting and people may not bother to help you.

In Crystal, it is best to use SELECT to get the data you want and then the various functions to get totals, maximum etc. It's not clear what you want, but if it is values with MV then you'd want a running total with a formula. The use of Crystal's automated totals is outlined at FAQ767-6524.

It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options. In this case, it probably makes no difference.


[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top