how to add numbers which is present in database on date basis in vb6.0 using adodc
15 1418
Hi,
use SQL Query:
Select Sum(Qty) From MyTable
Regards
Veena
how to add numbers which is present in database on date basis in vb6.0 using adodc
Did you mean Sum of Numbers, which Belong to that particular date.
eg, Sum of numbers for the date of July 05, 2007
and another sum for the date july 06, 2007 so on and so fort?
Did you mean Sum of Numbers, which Belong to that particular date.
eg, Sum of numbers for the date of July 05, 2007
and another sum for the date july 06, 2007 so on and so fort?
i want to add numbers(amounts) of seven days,month and so on.......date should automatically updated....... i want code for both..........
Hi,
Use this Query : -
sSQL = "Select Sum(Amt) From MyTable Where MyDate Is Between #" & txtFromDate.Text & "# And #" & txtToDate.Text & "# "
-
REgards
Veena
Hi,
Use this Query : -
sSQL = "Select Sum(Amt) From MyTable Where MyDate Is Between #" & txtFromDate.Text & "# And #" & txtToDate.Text & "# "
-
REgards
Veena
Private Sub cmdshow_Click()
sSQL = "Select Sum(Amount) From xdetails Where MyDate Is Between #" & txtFromDate.Text & "# And #" & txtToDate.Text & "# "
txtTotal.Text = Val(sSQL)
End Sub
but its not adding the amount,........
mydatabase contains two fields, one is date and another one is amount, when i enter 2 dates it should show the sum of amounts which is in database b/w these dates. ( in database i have given the date format as medium date)
hI,
What is backend db ..?
REgards
Veena
hI,
What is backend db ..?
REgards
Veena
i am using ms access 2000
instead of entering date in text box can i use combobox
Hi,
thers is no IS in the query :
sSQL = "Select Sum(Amt) From MyTable Where MyDate Between #" & txtFromDate.Text & "# And #" & txtToDate.Text & "#
Yes, u can use ComboBox :
CDate(Combo1.Text)
Regards
Veena
Hi,
thers is no IS in the query :
sSQL = "Select Sum(Amt) From MyTable Where MyDate Between #" & txtFromDate.Text & "# And #" & txtToDate.Text & "#
Yes, u can use ComboBox :
CDate(Combo1.Text)
Regards
Veena
Dim sSQL As String
Private Sub cmdTotal_Click()
sSQL = "Select Sum(Amount) From Table1 Where date Between #" & txtFromDate.Text & "# And #" & txtToDate.Text & "# "
txtTotal.Text = Val(sSQL)
End Sub
its not adding the amount..........
when i click the total cmd its coming 0
Hi,
you have to open a recordset, just by giving Val() will not work..
what i have given is just a Query.
To open a record set, just go through this thread
Regards
Veena
Hi,
you have to open a recordset, just by giving Val() will not work..
what i have given is just a Query.
To open a record set, just go through this thread
Regards
Veena
Dim sSQL As String
Private Sub cmdAdd_Click()
Adodc1.Recordset.AddNew
Text1.SetFocus
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdTotal_Click()
sSQL = "Select Sum(Amount) From Table1 Where date Between #" & txtFromDate.Text & "# And #" & txtToDate.Text & "# "
txtTotal.Text = Val(sSQL)
End Sub
Hi,
Declare a Connection object, Recordset Object : -
Dim sSQL As String
-
Dim AConn As New ADODB.Connection
-
Dim RST As New ADODB.Recordset
-
With AConn
-
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyDb.mdb"
-
.Open
-
End With
-
sSQL = "Select Sum(Amount) From Table1 Where date Between #" & txtFromDate.Text & "# And #" & txtToDate.Text & "# "
-
RST.Open sSQL, AConn
-
If Not RST.EOF Then
-
txtTotal.Text = RST(0) & ""
-
End If
-
RST.Close
-
Replace C:\MyDb.mdb, to ur actual database path
REgards
Veena
Hi,
Declare a Connection object, Recordset Object : -
Dim sSQL As String
-
Dim AConn As New ADODB.Connection
-
Dim RST As New ADODB.Recordset
-
With AConn
-
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyDb.mdb"
-
.Open
-
End With
-
sSQL = "Select Sum(Amount) From Table1 Where date Between #" & txtFromDate.Text & "# And #" & txtToDate.Text & "# "
-
RST.Open sSQL, AConn
-
If Not RST.EOF Then
-
txtTotal.Text = RST(0) & ""
-
End If
-
RST.Close
-
Replace C:\MyDb.mdb, to ur actual database path
REgards
Veena
thank you.....
thanks a lot..........
it helps me a lot........ i am d beginner of vb...... i want to learn more about vb..... thats y i m doing small pgms......... thank u for your cooperation
hi.........
i want to know about how to generate a graphs on this query basis.....(daily,weekly,monthly,yearly,totally)... ........ and also how to print these result plz help me.................
Hi,
Declare a Connection object, Recordset Object : -
Dim sSQL As String
-
Dim AConn As New ADODB.Connection
-
Dim RST As New ADODB.Recordset
-
With AConn
-
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyDb.mdb"
-
.Open
-
End With
-
sSQL = "Select Sum(Amount) From Table1 Where date Between #" & txtFromDate.Text & "# And #" & txtToDate.Text & "# "
-
RST.Open sSQL, AConn
-
If Not RST.EOF Then
-
txtTotal.Text = RST(0) & ""
-
End If
-
RST.Close
-
Replace C:\MyDb.mdb, to ur actual database path
REgards
Veena
Hello Veena
How can i do this with ADODC1.
I have three ADODCs on a form and i want to do this (sum of a column,field) with one of them with no date, time anyother restrictions iy just calculates the monthly expenses.
Thanx
Sign in to post your reply or Sign up for a free account.
Similar topics
by: August1 |
last post by:
A handful of articles have been posted requesting information on how
to use these functions in addition to the time() function as the seed
to generate unique groups (sets) of numbers - each group...
|
by: MConly |
last post by:
Can you tell me what happens inside CPU when I rand() ?
Where can I find the true rand function implemented ? I have heard
that rand() in C/C++ is n't a good one but why it isn't a good one,
are...
|
by: Eduardo Bezerra |
last post by:
Hi,
I'm looking for an efficient way to create the oposite of a
list of numbers.
For example, suppose I have this list of numbers:
100
200
300
|
by: rammohan |
last post by:
i want to implement an option similar to line numbers
option in c# editor. how can i display line numbers on
left side in text box.how can i know the present cursor
location with respect to...
|
by: peter_k |
last post by:
Hi,
I've to implement fast library for big numbers arithmetics. I'll store
the number in the table of unsigned long variables. And now i've a
question: what will be faster:
a) storing in one...
|
by: Subra |
last post by:
Hi,
What is the best way to find the 1000 largest numbers from the file
having hell lot of entries ? Can you please help me to find out the
way ? Do I need to go for B+ trees ??
Please help,...
|
by: shihaoran |
last post by:
I really need help with one my program; it is about arraylist; I do not get it. Can someone please help me with it?
Here's the instruction:
1. Your instructor will provide you with a text...
|
by: Chelong |
last post by:
Hi All
I am using the srand function generate random numbers.Here is the
problem.
for example:
#include<iostream>
#include <time.h>
int main()
{
|
by: Andreas Prilop |
last post by:
To get bold numbers in ordered lists, one can write
ol { font-weight: bold }
ol span { font-weight: normal }
<ol>
<li><span>......</span></li>
<li><span>......</span></li>
</ol>
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |