Results 1 to 3 of 3

Thread: [RESOLVED] Crystal Report Date Conversion

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Location
    South Africa
    Posts
    88

    Resolved [RESOLVED] Crystal Report Date Conversion

    Hi,

    I have a Date field on a SQL database stored as varchar. I want to call a report and select data for the current month but have to convert the text to date first. This is the code line I'm using :

    orpt.DataDefinition.RecordSelectionFormula = "{Month(convert(varchar(20), cast([Transaction Details].TDate as datetime), 103))} = " & dt.Month

    I keep on getting errors and I am not too sure if Im on the right track. Please assist
    High hopes go to all that looks down!!!

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Location
    South Africa
    Posts
    88

    Re: Crystal Report Date Conversion

    Ok, scrapt this idea. I dynamicly set the reports datasource to a dataset. But now, since I used the Database Expert to design the report, it creates the report with all the records showing as double on the report. How will I go about to avoid this from happening?
    High hopes go to all that looks down!!!

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Location
    South Africa
    Posts
    88

    Re: Crystal Report Date Conversion

    Solved!!!!

    Do not try to create a report with the Database expert and then dynamicly set the report's datasource. This will cause duplicate values.

    When you create a report use the command feature in the database expert, then create your report from the command you created. Then from there you can dynamicly set the report's datasource. This also made it possible for me to use normal SQL queries in VB.NET.
    High hopes go to all that looks down!!!

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