Click here to Skip to main content
15,896,259 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I made a project for software in vb.net and I use a crystal report where I used a view which I made in sql server 2000 and then I attached it by wizard.
There it shows all fields and its works fine but I need to ask that I am using there is a field which is shows a date which is saved in my sql database like this:

dd/mm/yy ( 10/11/2010)

So, my question is if anyone could tell me how I can sort this field here by date?
If used query then it is not working with query so how please tell any one complete code and way that how can I do that.
And please tell me how I can use time format like this:
10:20 am
10:30 pm

Please tell me all please
Posted
Updated 3-Nov-10 20:39pm
v3

1 solution

You can bring the data already ordered using the SQL (SELECT * FROM YOURTABLE ORDER BY YOURFIELD ASC). Or you can use the table property of Crystal Report and select the column to be ordered.

About the data format, you can use
FormatDateTime(DateTime.Now, DateFormat.ShortTime)

If you are in USA, for example, it will show you 10:20 pm, but, if you are in Brazil, for example, it will show you 22:20

Hope I could've helped you.
 
Share this answer
 
v2

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