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!

SQL Syntax

Status
Not open for further replies.

SarahS81

Programmer
Mar 18, 2004
19
AU
Can I please get some help with some SQL syntax? I am trying to query a Progress v9.1D database in Crystal 9 using the Merant 3.60 SQL92 odbc driver. If I was doing this in Access I would write the following..


SELECT IIf([pub_activity].[activitycode]="00","Working",[pub_activity].[activitycode]) AS ProdStatNew, PUB_Activity.ActivityCode
FROM PUB_Activity
GROUP BY IIf([pub_activity].[activitycode]="00","Working",[pub_activity].[activitycode]), PUB_Activity.ActivityCode;

I'm new to this and not sure how to structure the if function? If nnot could you please point me in the right direction to find out?

Thanks..
 
You'll do your calculation in a formula instead of in the query itself. Your formula will look like this:
Code:
If {pub_activity.activitycode}="00" then 
  "Working"
else 
  {pub_activity.activitycode}

-D
 
I've found CR9 had all sorts of problems with Progress DB's. It couldn't see the same DB tables I was using with Cr8.5.

I'm about to test CR10 with the same DB's and think that should work okay.

Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top