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

If then Else query

Status
Not open for further replies.

acr1

Programmer
Oct 12, 2001
73
NZ

Team
I have a field that needs to be changed when the report is printed....e.g. If the data in the field is 123640 then the report has to show 25 or if 123700 show 25A... I appreciate this is probably simple but am getting a bit screwed up...

Is their a limit to 'if then else' querys in a formula..??

Any help for the above would be greatly appreciated...

TIA
 
No limit that I'm aware of, though a reference table in your database might be the best means of handling this sort of thing.

Otherwise I'd suggest a case statement rather than an If, less "screwed uppable" to create and maintain.

select {MyTable.MyField}
case 123640: '25'
case 123700: '25A'
...
default : 'Doodly-squat'


-k kai@informeddatadecisions.com
 
Thanks
but cant seem to get it to work properly

Is 'case' valid in Seagate Info Vs7.0..?? and what happens at the end of your case statement..?

TIA


 
Case statements are only valid in CR8 and above. You could substitute the following, however:

If {table.field} = '123640' Then '25' Else
If {table.field} = '123700' Then '25A' Else ...
 
rhinok
That worked well..Thanks for your reponse.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top