CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Posts
    7

    Using Time condition in Crystal Reports

    In SelectionFormula Method for crystal report control placed on a VB Form
    Our Trial - CrystalReport1.SelectionFormula = "{TableName.FieldName}= '6:31:32 PM'" is not working.
    The Selected Field from the table is of Date/time Data Type with Long Time type Format.The Database is MS-ACCESS 7.0.The specimen data in the table for the field is 6:31:32 PM. The Report Screen is displaying some date - 12/30/99 instead of showing the time.There is no any option to specify the time format for the database field(Date / Time) dropped on to the report screen at design time.Kindly Suggest suitably.


  2. #2
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Using Time condition in Crystal Reports

    Hi

    I have never used this on 'Time'. For date this works: Use #yy/mm/dd# format. Ex Field = #99/2/10#
    For time, 24hr format may be better: Try
    {TableName.FieldName}= #18:31:32#
    Ravi


  3. #3
    Join Date
    May 1999
    Posts
    3

    Re: Using Time condition in Crystal Reports

    If you are using Crystal 7, right click on the date field that you are using and go to "Format Field" and then go to "Date/Time" tab and at "Order" select either "Date/Time", "Time/Date", "Date" or "Time" and then format the date or time under their respective folder tabs. Or if you open the report and go to File --> Report Options, you can change the format of how the field is converted from Access but this is not flexible with formating.
    Gary Caspelich

    GaryCaspelich

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

Featured