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!

Calculating Memo Fields

Status
Not open for further replies.
May 19, 2005
17
US
I am using CR9. I am trying to create a report where I calculate cost of a phone call. The database I am getting from the phone company is a CSV file. When I create a report for it, all the fields show up as String[255]. Half of my options are missing. I can't use SUM on running totals. Formulas fail because they expect a number or currency.

So I try to import my CSV file into an Access DB. I try a straight forward import. That results in the same failed formulas. During another import I tried to specify them as memo fields. Then I created a formula to be equal to that DB field and make calculations off of the formula. Still not working.

Any ideas? Thanks
 
I figured it out. Took a while. But I got it. However, I am not seeing how to turn a field into a date field. I need to prompt the user for a month required and the only way to do that is to compare the prompted value to a formula that pulls out the month. I can't do that unless I am able to take that String[255] field and read it as a date. Thanks
 
Hello!
Crystal has a pre-defined function called MonthName that will allow you to do just this...
once you have converted the field to date that is...
To convert to date use the CDATE function...
CDate(field)
I just checked in my crystal9 and both were there, in the Date functions...
The two choices you have for Month Name are...
MonthName (month) //month=the date field
MonthName (month, abbreviate) //abbreviated month where abbreviate is equal to a boolean value of "Yes" or "No"
Hope this helped...
I will check back later!
Boni
:)



Boni J. Rychener
Programmer
boni@hammerman.com
Hammerman Associates, Inc.
 
I ended up cheating on this one. There were three fields that had to do with time. The first was DATE, there was also TIME and DATE/TIME. The way I did it was to ask the user what month. They would type "May" I had a formula that converted that to 05. Then I had another formula that took the DATE/TIME and stripped out the 5th and 6th character and got 05. Then in the record selection I made sure that "PromptedValue = StrippedMonth" plus whatever else I wanted to match it with. Then I just displayed the Date and Time fields in the report seperatedly. The reason I did all this was the field was a STRING and not read as a number. So the MONTH(x) function would error out.

Now that it is working and the result is what I intended. I have one more problem. But I will open another thread for that. It has to do with Page Numbers starting over each time a group starts. Plus each group is set to start on a new page.

Thanks
 
:)
Whatever works!
As far as the page numbers go, check your Section expert and see if the "Reset Page number box is checked" for the group in question...
I will see if I can find your new thread...
Boni
:)


Boni J. Rychener
Programmer
boni@hammerman.com
Hammerman Associates, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top