Results 1 to 6 of 6

Thread: Crystal 9 selecting "123" all fields

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Location
    Mesquite
    Posts
    3

    Cool Crystal 9 selecting "123" all fields

    Help Please,
    Failed code in the Selection Formula (Record Selection) of Crystal Report V9:


    Select ALL FROM tblPatients ALL Like "stomatitis"

    I am a beginner and need more help than the on-line help provides.

    Objective:
    To select the word "stomatitis" from any of the 129 fields of the table tblPatients. The problem is this word could appear in any field.

    Any help would be greatly appreciated and I could pay a reasonable amount of money for your time and knowledge.
    Irene

  2. #2
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    I'm no expert, but I think you may be stuck with this is the record select function:

    {fieldA} = "text" or {fieldB} = "text"... adnauseum

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    From Crystal 8.5 help file...

    Like pattern operator
    Basic and Crystal syntax.

    The Like operator is useful for selecting records to include or exclude from your report.

    Usage
    x like y


    {fieldname} like "c?n*"


    This operator tests to see if the contents of {fieldname} matches
    a pattern that you specify in a character string "c?n*". If the
    contents of the field do fit the pattern "c?n*", then the formula
    returns the value True. If the field starts with anything else, the
    formula returns False.

    Use the wildcard symbols ? and * to stand for variable
    characters. The ? stands for a single character. The * symbol
    stands for any number of characters.


    Examples
    The following examples are applicable to both Basic and Crystal syntax:

    {customer.FIRST NAME} like "D?n"

    TRUE, where {customer.FIRST NAME} = Dan or Don.

    {customer.FIRST NAME} like "D?n"

    FALSE, where {customer.FIRST NAME} = Doug or Rob.

    {customer.LAST NAME} like "*s?n*"

    TRUE, where {customer.LAST NAME} = Johnson or Olson or Olsen.

    {customer.LAST NAME} like "*s?n*"

    FALSE, where {customer.LAST NAME} = Johnston or Smith.



    HTH
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Location
    Mesquite
    Posts
    3
    Thanks for the replies but please allow me to claify what it is I am trying to do.

    I have one table of 129 fields
    I wish to search all 129 fields
    for a pattern

    I keep trying the following syntax without any luck.

    Select * from tblPatients where *="stomatitis"


    I am saying select all fields
    from the table tblPatients
    where stomatitis

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    From the above examples I posted you can see that you need to
    list the field names in the Where clause. The wild card character
    will not work for the field names in the Where clause. So, you will
    need to list all 129 fields in your Where clause, but I dont know
    what the limit is for the length of the query in Crystal.

    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #6

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Location
    Mesquite
    Posts
    3
    Thanks for the information. Yes, I did find out that the limit was 1,000 or 2,048 chrc . I can't remember extactly what the error message said.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width