close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

order by month

Thread began 6/18/2010 2:17 am by mr hankey | Last modified 6/21/2010 4:39 am by mr hankey | 1848 views | 5 replies |

mr hankey

order by month

hi,

need some help with displaying months in the correct order on my chart.

here is my recordset:

SELECT MonthPaid AS XLABEL, SUM(Amount) AS YVALUEFROM monthlycommissionWHERE YearPaid= NOW( )GROUP BY MonthPaid

the column is a date column as the WHERE YEAR works fine but i have tried :

ORDER BY MonthPaidorder by MonthPaid
but no joy, also Tried



ORDER BY 'MonthName'ORDER BY 'MonthName'

and

ORDER BY MONTH Paid = 'MonthName'ORDER BY Month Paid = 'MonthName'

and does not work, it displays the data i need but just looks stupid going from June to March then to January instead of Jan feb etc

can you help impliment into the chart correctly?

thanks

Sign in to reply to this post

CraigRBeta Tester

I haven't (yet) played with dynamic webcharts.

However, I was wondering about your month sorting as i don't know how your information is stored.

could you extract the month from the date paid as an integer variable in your sql select statement and sort by this ?

Sign in to reply to this post

mr hankey

hi Craig R,

thanks for the repsonse, how would i extract to a integer variable? could you provide an exmple please?

thanks mate

Sign in to reply to this post

CraigRBeta Tester

as i said, i haven't played with dynamic webcharts, so dont know if this will help.

However, to extract the month number from a date field, in your mySQL select statement, add the following...

MONTH(datefield) AS monthnumber

where datefield is the field in your table and monthnumber is just the alias you want to use for the result.

This will return an integer between 1 and 12

Sign in to reply to this post

mr hankey

just to give you a quick background of setup:

i have 6 tables which all have a date column and i have created a view which stores all these due dates as 'DueDate', however when i order by month in the graph it does not work?

cheers

Sign in to reply to this post

mr hankey

hi craig, i managed to sort it.

must have had dumb moment, i changed the view to include the date column as stand alone as well as the year and month and then orderby the date column which works.

i had create my view with the month and year as an AS statement but forgot to inlcude the date column itself along with them.

works now thank god.

cheers

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...