473,385 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

graph on monthly basis

66
hi all...............
in my proj i am using a mschart ....
now what i want is i want to display the graph amount v/s months
I did the graph which shows date v/s amount its working good...
i used the sql query for that.... for month also i wrotequery but its not working properly....

what i need is it should add all the amounts which are entered in the particular dates on that month then it show the graph...

plz if u know that send me the answer

and my code is like this, this is for dates.......


Private Sub cmdGraph_Click()

Dim chrtArray()

'//
' Close the record set if open
'\\
If rst.State <> adStateClosed Then
rst.Close
End If



With Form1
Set cmd.ActiveConnection = cnn
cmd.CommandText = "SELECT Table1.TodayDate, Table1.Amount, Table1.Description" _
& " FROM Table1" _
& " Where Table1.TodayDate >= #" & txtFromDate.Text & "#" _
& " And Table1.TodayDate <= #" & txtToDate.Text & "#" _
& " ORDER BY Table1.TodayDate"

rst.CursorLocation = adUseClient
rst.Open cmd, , adOpenStatic, adLockBatchOptimistic

If rst.RecordCount = 0 Then
MsgBox "site does not have any availability data"
Exit Sub
End If
'//
' Give the record set to the gird for display
'\\
Set grdMonData.Recordset = rst
grdMonData.Refresh
'//
' C H A R T
'
' Dynamic 2-dimensional array to store series

' x-axis value in the 1st slot (i.e. chrtArray(x,1)
' y-axis value in the 2nd slot (i.e. chrtArray(x,2)
'
'\\
ReDim chrtArray(1 To rst.RecordCount, 1 To 2)

.MSChart1.ShowLegend = True
.MSChart1.ChartType = VtChChartType2dBar
.MSChart1.Title.Text = " Expence Details"
.MSChart1.Plot.Axis(VtChAxisIdX).AxisTitle.Text = "Date"
.MSChart1.Plot.Axis(VtChAxisIdY).AxisTitle.Text = "Amount"

' Load the array with data

For X = 1 To rst.RecordCount
chrtArray(X, 1) = rst!TodayDate
chrtArray(X, 2) = rst!Amount

rst.MoveNext
Next X


'//
' Attach the array of data to MS-CHART
' setup the column lable (the project id)
'\\

.MSChart1.ChartData = chrtArray
.MSChart1.ColumnCount = 1
.MSChart1.ColumnLabelCount = 1
.MSChart1.Column = 1
.MSChart1.Refresh
End With

End Sub
Oct 16 '07 #1
5 1630
QVeen72
1,445 Expert 1GB
Hi,

What Backend DB, u r using..?

Regards
Veena
Oct 16 '07 #2
rekhasc
66
Hi,

What Backend DB, u r using..?

Regards
Veena


hi.............
ms access.......................
Oct 16 '07 #3
debasisdas
8,127 Expert 4TB
try to use group by on sum of amount field .

and how can you display Description (character data) in MS chart control ?
Oct 16 '07 #4
rekhasc
66
try to use group by on sum of amount field .

and how can you display Description (character data) in MS chart control ?

i am not using description in graph, thats only to display in the flexgrid....
i used that one but its not working properly
Oct 16 '07 #5
rekhasc
66
i am not using description in graph, thats only to display in the flexgrid....
i used that one but its not working properly

SELECT MonthName([Todaydate]) AS MyMonth, Sum(Table1.Amount) AS SumOfamount
FROM Table1
GROUP BY Monthname([Todaydate]);

i got the ans for that....
thak u very much for u r replies
Oct 17 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Alison | last post by:
Four teacher's aides and I provide Basic Skills Instruction in Reading, Language and Math to over 100 K to 6 children in the BSI program. The BSI program is funded by government grants and as such...
0
by: tcread | last post by:
OBJECTIVE I'd like to be able to query the cumulative monthly returns of a given stock based on the daily returns. I need to do this for 1000 securities over 5 years (60 months) TABLES...
1
by: Heather | last post by:
I have created a unbound object frame and selected MS Graph and use my table to create my graph. Note I did not use the wizard. I open my MS Graph to change the stuff. How can I change the...
7
by: Lucas_london via AccessMonster.com | last post by:
Hi I have set up a database/tables in Access based on daily timeseries data. However I would like to create two additional columns in the table as a basis to pull the data on a weekly and...
0
by: Rog | last post by:
Who am I?: Hi I am a 'one-man-show' and mainly in the ecommerce and community business based in Western Europe. With over 13 years experience in the internet and telecommunication business, I...
4
by: rekhasc | last post by:
how to generate a graphs on query basis.....(daily,weekly,monthly,yearly,totally) i did the program on adding amounts on date basis , i want to know about how to generate a graphs on that..............
2
by: paeh | last post by:
moving average is the process that will be executed according to certain schedule such as daily, weekly or monthly based on the data in the database. For your information, I plan to use MySQL...
1
by: dosingh | last post by:
i've put this page together using asp, html, javascript amd flash. java passes a number of variables over to the flash file but the flash graph does not appear. The error which appears is...
0
by: iheartvba | last post by:
Hi, I have a line graph which shows monthly sales, on the vertical axis it has the amount markers and on the horizontal axis it has month markers formatted in "yy/mm" format. The line shows the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.