Startswith in Crystal

Posted on 2014-08-12
Last Modified: 2015-01-29
Hi there,
I'd like to consolidate my coding and currently have:

or Not Isnull ({CnGf_1AttrCat_1.CnGf_1AttrCat_1_Import_ID})
and {CnGf_1AttrCat_1.CnGf_1AttrCat_1_Comments} startswith "K12-"
or Not Isnull ({CnGf_1AttrCat_1.CnGf_1AttrCat_1_Import_ID})
and {CnGf_1AttrCat_1.CnGf_1AttrCat_1_Comments} startswith "K17-"
or Not Isnull ({CnGf_1AttrCat_1.CnGf_1AttrCat_1_Import_ID})
and {CnGf_1AttrCat_1.CnGf_1AttrCat_1_Comments} startswith "K18-"

Is there are something similar to the "in" function that will allow me to say
Not Isnull ({CnGf_1AttrCat_1.CnGf_1AttrCat_1_Import_ID})
and {CnGf_1AttrCat_1.CnGf_1AttrCat_1_Comments} in (startswith ["K12-" , "K17", "K18"]) just to consolidate it to make it easier for future reference?

Thanks in advance,
Question by:rporter45
    LVL 22

    Accepted Solution

    (Not Isnull ({CnGf_1AttrCat_1.CnGf_1AttrCat_1_Import_ID}) AND (
      {CnGf_1AttrCat_1.CnGf_1AttrCat_1_Comments} startswith "K12-" OR
      {CnGf_1AttrCat_1.CnGf_1AttrCat_1_Comments} startswith "K17-" OR
      {CnGf_1AttrCat_1.CnGf_1AttrCat_1_Comments} startswith "K18-" ))

    But for better performance, consider creating and using an SQL Expression that grabs the first 4 characters.

    Author Comment

    Now that sounds better! I will try and get back to you - I have been staring at this way too long,

    take care,

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
    Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now