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

Switch Statement Help

Status
Not open for further replies.

qwerty123987

Programmer
Mar 26, 2002
5
CA
Hey, can anyone tell me what I need to do to make the following syntax legal

This statement will work. Batchnumber[x] is a string array that either has a 5 character text string, or a single space in each element
{IVC.IVC_BATCH_NO} in switch
(
{?Report Type} = "P",
" " to " ",
true,
BatchNumbers[1]
)

However, I need to do something like this, which does not work. Crystal gives me an error saying "Not enough arguements have been given to the function"
{IVC.IVC_BATCH_NO} in switch
(
{?Report Type} = "P",
" " to " ",
true,
BatchNumbers[1], BatchNumbers[2], BatchNumbers[3]
)


Thanks
 
I don't have CR 8.5 but try this

{IVC.IVC_BATCH_NO} in switch
(
{?Report Type} = "P",
" " to " ",
true,
[BatchNumbers[1], BatchNumbers[2], BatchNumbers[3]]
)
or try with normal parenthesis instead of square brackets around "BatchNumbers". The problem is that Crystal is seeing the group of batchnumbers as other cases.

Also I don't think this is necessary: " " to " ",
I think that just " " would work as well. Jim Broadbent
 
Hello,

I have a string field that shows hours, minues, seconds in the following format HH:MM:SS. This field does not map to an actual time format because the hours part could span tousands of hours ie a typical value could be 4458:32:00 which means 4,458 hours, 32 minutes, 0 seconds.
I would like to build a formula which I can use to strip out the hours and minutes values into seperate values which I can perfom a calcualtion to determine the total number of minutes. ie hours * 60 + the minutes value.
I've tried using the split command but I am not sure how I can extract the array elements into their own variable.

Anybody have any ideas on how to handle this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top