Results 1 to 4 of 4

Thread: How To Write Formula In CR 8.0

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2007
    Posts
    7

    How To Write Formula In CR 8.0

    hay
    I am using Vb 6.0 And Crystal Report 8
    And I am Trying to Make A formula For Display record According To This Criteria
    First Select CustomerId
    Then Select only Those in Which Date is Between dtFrom to dtTo
    i have tryed my best but whole record of customerid is shown not Between dtFrom To dtTo
    is any one can help me
    Thanks

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

    Re: How To Write Formula In CR 8.0

    You would need to have your report already designed correctly so all you have to do is set the selection formula for either record or group.

    You can do something like this, just add in more code for passing parameters of the dates.

    Code:
    oRpt.RecordSelectionFormula = "({Table1.CustomerId} = iCustomerID) AND
    (({Table1.DueDate} >= DateTime (2008, 1, 29, 12, 42, 53)) AND ({Table1.DueDate} <= DateTime (2008, 1, 29, 12, 42, 53)))"
    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

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2007
    Posts
    7

    Re: How To Write Formula In CR 8.0

    I want to ask one thing more
    i want to use these variable to the parameters to CR
    first is CustomerID
    second is DtFrom
    third is DtTo
    then how is the statement will be
    AND
    which type of Date Format Should i used in database and in veriables
    Thanks

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

    Re: How To Write Formula In CR 8.0

    Here is one of my posts on parameters for CR.
    http://www.vbforums.com/showpost.php...0&postcount=16
    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

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