|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Result of a query into a variable in VB.NETHi 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? Hi,
Take a look at oledbcommand.executescalar http://msdn2.microsoft.com/en-us/library/system.data.oledb.oledbcommand.executescalar.aspx Ken -------------------- <Tom.Lism***@gmail.com> wrote in message Show quoteHide quote news:1148895995.058873.178100@i40g2000cwc.googlegroups.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? >
A (not so) basic question.
select case Type CLS-Compliance and Array Parameter Rank Obtain contents of an external listview and/or treeview breaking up strings Datagrid scrollbar ¿How can I to get the time of execution of an application? ADO.NET and Currency Manager/Binding Context (Newbie question) create registry key Can you embed a SQL database? |
|||||||||||||||||||||||