Click here to Skip to main content
15,900,511 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello !
i have really strang problem with Crystal Report. i am trying to create a report using crystal Report. i used Access as database and i have these fields in my database :

field name--------------Data Type
ps_entrydate ---------- Date/Time
ps_name -------------- Text
ps_surename ---------- Text
ps_age ---------------- Number

when i retrieve data into datagridview , date format is in 02.02.2011 and is ok but when i try to print it into Crystal Report , the date looks something like this 07.02.2011 00:00:00. i dont want this format i want shot format (02.02.2011 ).
i have no idea why is happening like this. before forget , when i change the date/Time to Text (ps_entrydate Text) , it looks fine but this time i can not search by date :~
i tried these method, but none of them work to me :
toShortDateString();
toString ("dd/MM/yyyy");

any help is most appriciated . please help , thanks in advance
Posted
Updated 5-Mar-11 21:47pm
v8

Member 7696839 wrote:
when i change the date/Time to Text (ps_entrydate Text), it looks fine but this time i can not search by date

Never do that thing man, just change the the data type as into date time again.
Now you need to format the date time in crystal reports, that's all. Here you go

Formatting Dates in Crystal reports[^]

Also you can use formula for the same thing. Example. ToText({ps_entrydate}, "dd-MMM-yyyy")
 
Share this answer
 
I had the same problem, I think. There is a work around for it. That is, assuming that you are grouping by the date (ps_entrydate). If not, then I don't know what to tell you.

But if so, then the report performs the search correctly, but doesn't display the result correctly.

What helped for me was to display the date, in your case ps_entrydate, twice, once as the group by field, and again as a field on the report. You'll notice that the report field displays correctly, while the group field does not. Go figure.

Once you're sure that the date field displays correctly, delete the group field and move the other date field in place of it.

Crystal Reports will still search on the group by date but will display the date field on the report, not the group field (which is actually the same).
 
Share this answer
 
thank you very very much
VB
thatraja177K
. your link helped and i solved the problem.

also thanks for your offer
VB
ndrew Alix399
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900