Results 1 to 5 of 5

Thread: Crystal Report9 Date format

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    3

    Crystal Report9 Date format

    Dear brother,
    I am a hobist. I am working with VB6 and wants to report by Crystal Report9. I am using Access 2000 Data base.
    I want to inter link Crystal report in VB6. I can connect and it is working with Record SelectionFurmula perfectly for Character and Number data.
    But when I am using DATE Field in Recordselectionformula it is not working correctly. In data base I made DATE field Short Date.My Computer date format is also dd/mm/yyyy format .
    In VB6 date query working working perfectly by format ( Examp: Format (# " & TextDate.text& "#,' mm/dd/yyyy'), bul in Crystal report9 it is not working.
    Recordselectionformula can retrive dates 31/01/2006, 13/12/2006, But when Date is like 01/02/2006 or 05/06/2006 then it can't retrive any record.
    Example :

    Report.recordselectionformula="{TableName.DatefieldName}=#" & TextDate.Text & "#" #
    If Possible help me. How can overcome it. I will be greatful to you.

    Thanks

  2. #2
    Addicted Member craigreilly's Avatar
    Join Date
    Jul 2004
    Location
    Scottsdale, AZ
    Posts
    188

    Re: Crystal Report9 Date format

    Have you tried it with a time of midnight? ("2005-04-29 00:00:00")
    I know many of my databases store the time in with the date field.
    VB 6 / VB.NET 2003, 2005 / Crystal Reports 9-12

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    3

    Re: Crystal Report9 Date format

    Date can be displayed in "yyyy/mm/dd" format but I want to display in report in ""dd/mm/yyyy" . How can be done.

  4. #4
    Hyperactive Member shirishdawane's Avatar
    Join Date
    Dec 2004
    Location
    Mumbai,India
    Posts
    363

    Re: Crystal Report9 Date format

    Quote Originally Posted by siraj107
    Report.recordselectionformula="{TableName.DatefieldName}=#" & TextDate.Text & "#" #
    Thanks
    Do it in this way:

    VB Code:
    1. Report.recordselectionformula="{TableName.DatefieldName}=#" & Format(TextDate.Text,DD-MMM-YYYY) & "#" #
    On Error GoTo http://www.vbforums.com

    Note :
    1) Please use [vbcode]your code goes in here [/vbcode] tags when posting VB code.
    2) Please mark thread as Resolved using the Thread Tools menu, if you got solution.

  5. #5

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    3

    Re: Crystal Report9 Date format

    Thank you for reply. I solved it in other way. But Your way is more easy and short.
    Thanks

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