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

Crystal Syntax to SQL

Status
Not open for further replies.

Patrick69

IS-IT--Management
Nov 30, 2005
15
CA
I've recently started at a position and and in the process of cleaning out a mess of uneeded records (1000's). However I have been a Network Tech for a while and am only recently back into programming. I have created the queuery in Crystal (v7 7) and need to create the exact same one in Pervasive 7 so I can delete the records. Any guru's out there able to give me a conversion?

basically the report looks up a field to see what the date is after the word ENDING(I had to cut of the beginning of the field as the date is there also)

--------------
local stringvar ENDING;
local stringvar STARTSTRING;
local numbervar STARTPOINT;
local numbervar LEN;

LEN := Length ({Rules Text.RULE TEXT}); //size of field
STARTPOINT := InStr ({Rules Text.RULE TEXT},"ENDING") -1; //locate startpoint of word ENDING
STARTSTRING := Right ({Rules Text.RULE TEXT}, LEN-StartPoint); //truncate all data in field before the word ENDING

//check if any of the rules in truncated field contain the year 2000-2004
if InStr (STARTSTRING,"2000" ) > 0 or
InStr (STARTSTRING,"2001" ) > 0 or
InStr (STARTSTRING,"2002" ) > 0 or
InStr (STARTSTRING,"2003" ) > 0 or
InStr (STARTSTRING,"2004" ) > 0
then STARTSTRING
else ""; //leave field blank if conditions not met

I'm researching to do it as you read this but I appreciate any help you can give me.

thanks in advance
 
I believe there is a "View SQL" menu in Crystal that might give you a starting point.

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
Custom VB and Btrieve development.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top