-
-
why this sum function won't work ?
-
eg Sum(personal)
-
lblPersonal.Caption it wont retrieve the sum value of personal
-
-
Dim cn6 As New ADODB.Connection
-
Dim strCNString4 As String
-
Dim rs6 As New ADODB.Recordset
-
Dim intFound6 As Double
-
-
strCNString6 = "Data Source=" & App.Path & "\PayrollBakeryDB.mdb"
-
cn6.Provider = "Microsoft Jet 4.0 OLE DB Provider"
-
cn6.ConnectionString = strCNString6
-
-
cn6.Open
-
-
With rs6
-
'.Open "SELECT Sum(personal), Sum(sick), Sum(vacation), Sum(maternity), emp_id, from_date, to_date FROM leavela WHERE Month(from_date)=" & intMonth & " and Year(from_date)=" & intYear & " and Month(to_date)=" & intMonth & " and Year(to_date)=" & intYear & " GROUP BY emp_id, from_date, to_date ", cn6, adOpenDynamic, adLockOptimistic
-
-
Do Until .EOF
-
-
If !emp_id = txtEmp_ID.Text Then
-
lblPersonal.Caption = rs6.Fields(0) 'here
-
lblSick.Caption = rs6.Fields(1) 'here
-
Vacation.Caption = rs6.Fields(2) 'here
-
lblMaternity.Caption = rs6.Fields(3) 'here
-
-
intFound6 = 1
-
End If
-
-
.MoveNext
-
Loop
-
-
'If intFound6 = 0 Then
-
'MsgBox "Employee ID not found !", vbExclamation, "Error"
-
'End If
-
-
End With
-
-
-
-
1 1094
Can you give us more of an idea as to what the problem is, than "won't work"?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Paddy |
last post by:
I was browsing the Voidspace blog item on "Flattening Lists", and
followed up on the use of sum to do the flattening.
A solution was:
I would not have thought of using sum in this way. When...
|
by: adnanahmed714 |
last post by:
i am trying SQL Sum() function in vb to get sum of one database column but not getting result.
select Sum(columnname) from emp.
help me i want sum value to display in textbox.
also i...
|
by: n8kindt |
last post by:
i don't know what to do about this one. there are some very strange things going on. i have a continuous form with a bound textbox and a bound toggle button. the textbox is named "Payment" and the...
|
by: bearophileHUGS |
last post by:
Empty Python lists don't know the type of the items it will
contain, so this sounds strange:
0
Because that may be an empty sequence of someobject:
0
In a statically typed language in...
|
by: azegurb |
last post by:
Hello, I have one question again
i created one table again and in this table i added some another options
for ex at the previous table there were only one problem sum of the dynamically added...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |