[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Chart Axis

Posted on 2013-05-12
7
Medium Priority
?
289 Views
Last Modified: 2013-06-14
I am having problems with the x axis on a bar chart

If the user picks Last Full Month - I want to show the data by day i.e. 01/05/2013, 02/05/2013. This works correctly

If the user picks Last Full Day I want to display the data  by hour i.e. 1:00,2:00 - at the moment this does not display in the correct order i.e. displays 1:00,10:00,11:00,12:00 instead of 1:00, 2:00, 3:00 etc.

My formula is as below

if {?datechoice} = 'Last Full Day' then totext(hour({Command.sentdatetime}),2,"" ) else
if {?datechoice} in [ 'Last Full Month'] then totext(cdate({Command.sentdatetime}),'dd/MM/yy' )

Is there a way I can correct this to show it in the right order?

Using CR2008
0
Comment
Question by:halifaxman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 39160353
Try

ToText ({Command.sentdatetime}),'yy/MM/dd' )


mlmcc
0
 

Author Comment

by:halifaxman
ID: 39161543
Thanks for the answer

The data for day works correctly i.e. totext(cdate({Command.sentdatetime}),'dd/MM/yy' ) - this displays in the correct order 01/05,02/05 etc

The data for hour totext(hour({Command.sentdatetime}),2,"" ) - does not display in the correct order, this displays  1:00,10:00,11:00,12:00  etc. I need it to display as 1:00,2:00,3:00 etc
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 39161629
Try

totext(hour({Command.sentdatetime}),"00:00" )

mlmcc
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 

Author Comment

by:halifaxman
ID: 39161701
Tried the above, got the error

Bad number format string
0
 
LVL 35

Expert Comment

by:James0628
ID: 39164099
If you just want the hour, without the minutes, but want to include ":00" for the minutes (as in your examples), you can use:

totext({Command.sentdatetime},"hh:00")

 Or, to get just the hour:

totext({Command.sentdatetime},"hh")


 Note that I didn't use the Hour function.  ToText is extracting the hour from the datetime and formatting it.

 Interestingly, ToText doesn't like a ":" in a format string for a number (like the result of the Hour function).  That's why you got an error on mlmcc's suggestion.  But it allows it when formatting a datetime, including "hh:00" (which gives you the hour, followed by ":00").

 James
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 39164667
Try

totext(hour({Command.sentdatetime}),"00" ) + ":00"

mlmcc
0
 
LVL 35

Expert Comment

by:James0628
ID: 39167537
Yeah, that would work too.  Never thought of that.  :-)

 James
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question