[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
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?
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.