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

Which variable to use

Status
Not open for further replies.

mtownbound

Technical User
Jan 28, 2002
293
US
I'm just trying to figure out which variable to use with a date format of 02/25/03, etc.

Here is an example of what I was attempting to use:

whileprintingrecords;
DateTimevar dateOnChangeOf;
dateOnChangeOf := dateOnChangeOf + {sheet1.date};



Thanks!!!
 
What are you trying to do?
Your formula will return a date if {sheet1.date} is a number.

Mike
 
whileprintingrecords;
DateTimevar dateOnChangeOf;
dateOnChangeOf := dateOnChangeOf + {sheet1.date};
********

Well if there is no time involved it is not necessary to make the variable dateTime.

Also it is not clear what you are trying to do with the math....have strings added together or some kind of numeric calculation of dates

If it is string concatenation then this would work fine


whileprintingrecords;
Stringvar dateOnChangeOf;
dateOnChangeOf := dateOnChangeOf + ", " +
totext({sheet1.date},"MM/dd/yy");



Jim Broadbent
 

Basically, I'm trying to create a formula, for a subreport, which will be based on two running total formulas.

This is just one of my running totals formulas.


Thanks!!!
 

Sorry, I missed one of the replies.

I am trying to concatenate these values, which will be split in the subreport.

The bottom line is I'm trying to chart that formula field which is based on the two running total fields.
 
you should explain everything....at the beginning....not a little bit at a time...I am not certain you have given us all the info....too sketchy to comment on

Jim Broadbent
 

OK, here ya go:

This is my data:

Date Saleperson Shoes sold Sold to males Percent
5/12/03 Smith 80 20 25%
5/13/03 Jones 100 50 50%
5/14/03 Walker 50 5 10%

Totals 230 75 32%

Now what I need to do is create a line chart that shows the percentage of 32%(which is 75/250*100) NOT the AVG that is going to add 25%+50%+10% and show 28.33% on the chart.

I know I can't use @total male sneakers percent, because that is a formula based on the running totals. So I have the data listed above in my main report and am attempting to take the two running totals, link then in the subreport, and create my chart using the subreport.

Hope this is clear enough.


Thanks guys!!!
 
NGOLEM,

I tried the formula you gave me, but I need to concatenate and increment the dates(2/01/03,2/02/03,02/03/03, etc). The formula you gave me lists the dates, but instead of listing all the dates, it appears as 02/01/03,02/01/03,02/01/03. I changed it to read:

//This formula is written in Crystal syntax.
//Name this formula 'OnChangeOf'.
whileprintingrecords;
Stringvar dateOnChangeOf;
dateOnChangeOf := dateOnChangeOf + ", " + {Sheet1_.Date} + totext({Sheet1_.Date},"MM/dd/yy");

However, I need a string at the + {sheet1_.date} + totext....

Do I need to use a different variable?


Thanks a million!!!!
 
I don't really understand your incrementation

02/01/03,02/02/03,02/03/03

what format is this MM/dd/yy or dd/MM/yy??

How does the other date figure into this

You have several Sales dates of data...You want to plot the Average I I understand that....But this date formula escapes me...Are you looking for an average date of some kind?? Your formula isn't doing that

By your example you have 2 dates 5/13/03, 5/14/03, 5/15/03

Are you trying to get a date of 5/14/03 to plot your point against???

Jim Broadbent
 

I am trying to get a daily average(hidden), but plot the monthly average in a chart based on "Shoes sold to men/shoes sold" not the percentage column. The dates come into play with the daily data being "printed" to be used for the monthly calculation.

Sorry if I'm making this more complicated than it really is.


Thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top