Formatting a date displayed in a crystal report
Hello
I am using VS 2005 CR 10.
I am using typed datasets to populate a report.
From my database I have 1 field called incidentDate, this is a smallTimeDate datatype.
My reports always displayes the correct date, but is followed by the time which is always 12:00. For example 18/12/2006 12:00 AM.
I don't want to display this time. I have tried setting the DateWindowsDefaultType in the report properties for that field. But this did not work.
Does anyone have any other ideas,
Thanks very much,
Steve
Re: Formatting a date displayed in a crystal report
Right click on the Date and click on the Format and select the date from There. :wave:
Re: Formatting a date displayed in a crystal report
Thanks for your answer Shakti, but it didn't work.
I did the right click | format object | I selected the format 12/12/2006 and then clicked ok. But did not work.
I also deleted the field and inserted a new one, and did the same as above, but it always displayes this "12/12/2006 12:00:00 AM".
I want to get rid of this time, its driving me nuts.
Any ideas I would be most grateful.
Steve
Re: Formatting a date displayed in a crystal report
If your variable is date Type then the Format will be work , Other thing you can do that just make a formula and put the variable in the formula and change format there.
Re: Formatting a date displayed in a crystal report
Thanks Shakti,
It did work what you said. I did that before, but I was loading the wrong report. Just released my mistake.
However, I am interested in this formula. Can you give me some sample code on how to write this formula. I would like to learn how to do this.
Many thanks for your help,
Steve
Re: Formatting a date displayed in a crystal report
i think it would be like this
cdate(left(datetimevar,8)
Re: Formatting a date displayed in a crystal report
Thanks,
I will give that a try.
Re: Formatting a date displayed in a crystal report
IF my syntax has helped u then do rate it and pls mark resolved to this problem.