Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sort order time

Status
Not open for further replies.

ali1227

MIS
Jul 21, 2005
24
CA
i have a report that has two days data start from yesterday 12:00 pm to todays 12:00 pm when i plot a graph agianst these date the graph comes okay. My manager wants to just show time not the date but when i convert the datetime to time it change the graph sequence order. It shows the todays data first then the yesterday data. Is there a way i can maintain the sequence and only shows the time without date at x axis of the graph
 
Do a formula field to convert: e.g. if date = currentdate then "To 12pm" else if date = currentdate-1 then "From 12pm" else "WHATEVER". Use this instead.

There may be a problem using formula fields for graphs in some Crystal versions. It helps anyway to say if you have 7, 8, 8.5, 9 or whatever.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thanks Madawc i forgot to mention, i am using crystal report 9 and i am plotting graph for each hour. Currently i work around with formula but not in a smart way. I did a formula like
if time(date field) = '12:00 pm' then
' 12 pm'
and so on.
I am using spaces to adjust sequence. It is working fine but if there is better way please let me know.

 
You shouldn't convert the time to a string. Use:

time({Table.datetime})

...for your on change of field and then click on "Order" and choose "Specified order" and then order your times in the dropdown box.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top