473,386 Members | 1,630 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,386 software developers and data experts.

Result of a query into a variable in VB.NET

Hi there,

I'm currently working on a small project to create an overtime hour
app. I'm a little bit stuck on the part where I want to make the sum of

all the overtime hours entered in my db.
I'm working with an Access db. Users can enter the amount of overtime
hours performed on a single day. Every day is 1 record. What I want to
do now is make the sum of all the hours that were entered and pass it
into a variable. I can create the query with a SELECT SUM (...) but I
don't know how to pass the result back into a variable in VB. I need to
have it in a variable in VB because I need to do some calculations with
it.
Could somebody help me out with this one?

May 29 '06 #1
2 1520
Hi,

Take a look at oledbcommand.executescalar
http://msdn2.microsoft.com/en-us/lib...utescalar.aspx

Ken
--------------------
<To*********@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
Hi there,

I'm currently working on a small project to create an overtime hour
app. I'm a little bit stuck on the part where I want to make the sum of

all the overtime hours entered in my db.
I'm working with an Access db. Users can enter the amount of overtime
hours performed on a single day. Every day is 1 record. What I want to
do now is make the sum of all the hours that were entered and pass it
into a variable. I can create the query with a SELECT SUM (...) but I
don't know how to pass the result back into a variable in VB. I need to
have it in a variable in VB because I need to do some calculations with
it.
Could somebody help me out with this one?

May 29 '06 #2
Thnx , This is what I was looking for.

May 29 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: dogu | last post by:
Noob alert. Code is below. File is saved as a .php. What I'm trying to do: User uses 'select' box drop down list to pick a value. Value ($site) is derived from a db query. This works fine....
4
by: Bob Bedford | last post by:
We have no access to a mysql NG on my provider's server, so we ask here: We have a long query (long in text) with a UNION between 2 select. We have been informed that some times the query...
9
by: Petr Vileta | last post by:
Hi, I'm new here and excuse me if this question was be here earlier. I have a simple code <html><body> <?php <?php $link = mysql_connect("localhost", "user", "password") or die("Grr: " ....
10
by: Tony K | last post by:
How would I assign the result of a SQL query to a variable. The result of the following statement will ALWAYS result in 1 row returned. SELECT ProductDescription, ProductID FROM ...
9
by: JRough | last post by:
I tried to pass the $result from a mysql_query in a url like this line Header("Location:clm_historyXL.php?_result=".$result); but on the redirect location clm_history.php page I get an error on...
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...
0
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...
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...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.