Access :: Add Two Selected Statements

Feb 9, 2010

I want to add Sum contents from the two tables, Realize the rows could be different, Only like rows to be added rest of the rows from both tables are listed.

SELECT TYPE AS CashFlow, Sum(AceData.InCredit) AS Credit, Sum(AceData.OutDebit) AS Debit, Sum([InCredit]+[OutDebit]) AS Totals
FROM AceData
where case=1
GROUP BY Type;
CashFlow Credit Debit Totals
Advert $0.00 ($5,816.52) ($5,816.52)
BOND $0.00 ($3,060.00) ($3,060.00)
Cash $18,619.57 ($34,824.75) ($16,205.18)
Charity $0.00 ($6,578.00) ($6,578.00)
DayCare $0.00 ($2,360.00) ($2,360.00)
SELECT TYPE AS CashFlow, Sum(AceData.InCredit) AS Credit, Sum(AceData.OutDebit) AS Debit, Sum([InCredit]+[OutDebit]) AS Totals
FROM AceData
where case=2
GROUP BY Type;
CashFlow Credit Debit Totals
BOND $0.00 ($3,060.00) ($3,060.00)
Cash $18,619.57 ($34,824.75) ($16,205.18)
Charity $0.00 ($6,578.00) ($6,578.00)
DayCare $0.00 ($2,360.00) ($2,360.00)
Entertainmen $0.00 ($12,258.18) ($12,258.18)
Equipment $0.00 ($7,085.00) ($7,085.00)
Fee $1,957.63 ($27,611.85) ($25,654.22)

View 4 Replies


Similar Messages:

Databases :: Join Two Sql Selected Statements

Jan 25, 2010

how to join 2 sql select statements in Oracle, which has different number of rows. That is I have first select statement which fetchs around 80 records in below format.

DATE MONEY
12-01-2010 10
12-01-2010 15
12-01-2010 15
12-02-2010 15
12-02-2010 15
12-03-2010 15
12-03-2010 15

Second statement will give reocrds like below. That is it will give only distinct dates. Please tell me how to join these two queries. So that I can get

DATE Rank
12-01-2010 a
12-02-2010 b
12-03-2010 c

how to join these two queries. So that I can get result set in below format.

DATE MONEY Rank
12-01-2010 10 a
12-01-2010 15 a
12-01-2010 15 a
12-02-2010 15 b
12-02-2010 15 b
12-03-2010 15 c
12-03-2010 15 c

View 4 Replies

DataSource Controls :: Update / Insert And Delete SQL Statements For Define Custom Statements Wizard

Feb 23, 2011

I'm using the 'Configure Data Source' wizard to connect to my database and show the dataset in Gridview. I want to be able to update, insert and delete entries but am unsure how to build the query. I can write simple update statments to change database entries but how can I do this for entries that have been changed within the gridview?

View 6 Replies

Access :: Print A Specific Access Report With Selected GridView Record?

Sep 17, 2010

I have my code output a gridview with all the data with an option to select records. I'm trying to make a code which would allow me to select a record, and then print this record using a specific Report stored in MS Access.

I've located the code to print the Report it self, but it prints ether all the records or a range.

View 3 Replies

C# - Access WebUserControl DropDown Selected Value Want To Use On 5 Pages?

Sep 5, 2010

I have a dropdown inside a webusercontrol which I want to use on 5 pages. I want to save the selected value of the dropdown from the page. I tried to access it using below method, but its not working[URL]

View 1 Replies

C# - Access The Selected Node In The Treeview Using The Request Array?

Mar 4, 2010

Suppose I have a treeview, where each treenode contains an id for a different set of user controls. When the user clicks a node, these controls should be loaded to the page. As I understand the ASP page life cycle, dynamic controls should be added in the initialization stage, and postback events will fire later on.

So if the treeview click event happens after I need to add my controls, how do I dynamically add controls based on user postback events?

Edit: I tried the ArronLS:

What I did was add the node value to the session array, and use that when I do the init to choose which form elements to load to the controls of a placeholder control. On the treeview click event, I update the node in the session array, clear the old form elements in the placeholder, and add the new form elements to the controls. When the page is loaded again, it should now find the node at init time, so viewstate problems would be circumvented.

Now I haven't fully tested this yet, but there was another similar post that talks about the problems that might result with the viewstate. They suggest a solution that polls the Request[] part of the context (in their case the dropbox) within the Init control, manually handling some of the postback functionality.

My new question is how to I access the selected node in the treeview using the Request array?

View 4 Replies

How To Access In Server Side AspxGridView Combobox Selected Value

Jan 7, 2011

I want to access selected value of GridViewDataComboBoxColumn in server side at GridViewUpdated event. Do you have any idea about how can it be?Here is columns of AspxGridView

<dx:GridViewDataComboBoxColumn Name="Sprint_id" Caption="Sprint" FieldName="refSprint_id" VisibleIndex="8">
<PropertiesComboBox ValueType="System.Int32" DataSourceID="sdsSprintler" TextField="adi" ValueField="sprint_id">
</PropertiesComboBox>
</dx:GridViewDataComboBoxColumn>

Combo can fill but i couldnt access the selected item in GridView updated event

View 1 Replies

MVC :: Access Selected Item's Description In Html.DropdownList?

Feb 7, 2010

I have a MVC dropdown list (Html.DropDownList) with list of Movies populated. I want to retrieve both Title(value field), Description(Text field) when I perform the form Submit. I can access the Title(value field), but I can't access the description. My code sample is below.

[Code]....

public string CinemaName { get; set; }

View 4 Replies

Web Forms :: How To Access The Selected Item From The Radio Button List

Jan 11, 2011

I'm trying to figure out how to access controls that are added to a panel in a code behind file.For example, when I click a button, I add a radio button list to the panel.How do I access the selected item from that radio button list? I get an error saying it is not defined, even though list gets generated..

View 4 Replies

Forms Data Controls :: Access Value Of Column In Selected Row In Gridview

Nov 9, 2010

I have seen a lot of things on the net on this but nothing seems to work. I have a GridView with name and other information on files stored in a database but also on a Server. I display the gridview with the files and the user selects the file to delete (row) by hitting the command field for Delete. I have an event on the gridview for code behind. Here I want to access the file name for the row selected, to be able to include it in the File.Delete statement.

Even before this I want to display the selected file name in a label back to the web page. I have tried everything including findcontrol selectedValue, etc. Nothing is working. I either get complier error, or nothing is displayed in label. If I let it go the the File.Delete step I get access error becasue there is no file name. HELP. here is screen shot of the gridview. Ignore the download button for now. That is my next headache to figure out. So based on the screen shot I want the value of log_doc from the gridview. It is in a column called file_name

File ID
File Name
Log
Upload Date
Uploaded By
Download
Delete
3

View 5 Replies

Data Controls :: Find DropDownList And Access Its Selected Value In GridView Row?

Jan 4, 2013

i have gride view and there are three dropDownList in every row in grideview,i want get selected value from every DropDownList,and pass the values to storeprocedure in sql,I dont know how pass value every row, to store procedure,and StoreProcedure get 3 value.

View 1 Replies

Javascript - Trying To Add A Client Side Event To A Dropdownlist And I Need To Access The Currently Selected Text?

Sep 1, 2010

I am trying to add a client side event to a dropdownlist and I need to access the currently selected Text. I have tried:

ddl_tech.Attributes.Add("onclick", "document.getElementById('" + chk_techreview.ClientID + "').disabled = this.options[this.selectedIndex].text.Equals(' UNASSIGNED');");
and
ddl_tech.Attributes.Add("onclick", "document.getElementById('" + chk_techreview.ClientID + "').disabled = this.text.Equals(' UNASSIGNED');");

Both of which give me runtime errors when the event is fired.Whats the correct way to access this text property client side?I tried this but it does not enable the checkbox...

ddl_tech.Attributes.Add("onchange", "document.getElementById('" + chk_techreview.ClientID + "').disabled = this.options[this.selectedIndex].text == ' UNASSIGNED';");

ANSWER:

Well, along with having to use == rather than .Equals, when you set a checkbox.enabled = false on the server side it raps the checkbox in tags and sets it to disabled=true; therefore you must set BOTH the checkbox.disabled = false and checkbox.parentElement.disabled = false; on the client side to enable the checkbox!The solution:

ddl_tech.Attributes.Add("onchange", "document.getElementById('" + chk_techreview.ClientID + "').parentElement.disabled = (this.options[this.selectedIndex].text == 'UNASSIGNED'); document.getElementById('" + chk_techreview.ClientID + "').disabled = (this.options[this.selectedIndex].text == 'UNASSIGNED');");

View 2 Replies

Forms Data Controls :: Access A Servercontrol (checkbox ) From Jscript And Check If It Was Selected?

Jan 25, 2011

I have a gridview that contains check box in first column for each row. I also have a check box outside the grid view called >>>>

<asp:CheckBox ID="chkSelectAll" runat="server" Text="Select All" AutoPostBack="true"
OnCheckedChanged="chkSelectAll_CheckedChanged" />

I either can select more than one checkboxes from gridview then click on a button to get the number of checkboxes selected OR I click on SelectAll checkbox ( which is outside the gridview ) which check all the checkboxes in the gridview and give me the number of checkedboxes. When I select inidividual checkboxes inside the gridview, th e count of number of checkboxes is correct ( displayed in a lable ) However;

When I click "SelectAll" check box, it give me total of all checkboxes chekced in the
gridview + 1 ( extra ) I am trying to get rid of this extra one by checking if this "Allcheckbox" is selected to so I subtract one from the total count .. like this

// java code ... code not shown does capture the total count into c variable
varAllChecked = document.getElementById('chkSelectAll');
if (varAllChecked.checked== true)
litCount.innerText = c - 1;
else
litCount.innerText = c;

View 5 Replies

AJAX :: To Get The Selected Index,selected Value , Selected Text Using Javascript Of Combobox Control

Feb 17, 2010

Can i get the selected index,selected value , selected text using javascript of ajax combobox control. if yes send me the sample code.

View 7 Replies

Understanding Of SQL Statements?

Jan 3, 2011

string sqlstring =
"SELECT DISTINCT STAFF_ID, SCHOOL_CODE FROM MODULE_TIMETABLE_STAFF WHERE STAFF_ID != '" +userId +
"' AND STAFF_ID LIKE '%" + Searcht +
"%' ORDER BY STAFF_ID ASC";

can anyone explain this statement for me? especiallythese signs !=,+ +

View 4 Replies

Forms Data Controls :: Access Nested Gridview Selected Row In Order To Use Selectedindexchanging Event

Jan 27, 2011

I have parent gridview5 and nested child gridview6 within it. The page is working as expected and formatted as i need it now.. I added a select button to the child gridview6 and when i click on it i get an error: {"Object reference not set to an instance of an object."}

I found examples of using the find control, but within the parent gridview.. and i use that fine with other controls.. but cant figure out the right combination of finding the selected row for the nested gridview so that i can display a modalpopup.

View 8 Replies

Forms Data Controls :: Access Radio Button List Selected Value From Repeater Control?

Dec 29, 2010

I have a user control (this has a label to display question and a radio button list to show options).

I am using this user control inside a repeater to display all the questions with their options.

In my repeater page I am not able to capture SelectedValue of radio button list.

protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)

View 4 Replies

SQL Server :: How To Schedule Several Statements

Aug 2, 2010

How can I schedule several statements that involve select ... into ..., delete, and exec one other stored proc, periodically? For instance, every 6 hours, in Sql server DB

View 1 Replies

ADO.NET :: Include More Than Sql Statements Into SqlReader

Jan 2, 2011

i want to execute more than one query in a page.i tried to use sqlreader it didnt allow me to include.how to do ?This is my code.

[Code]....

this is how i did.it shows me error.how to solve this error?

View 3 Replies

Define Using Statements In Web.config?

Apr 16, 2010

I'm using MySql in my asp.net project. But I don't want to type every "using MySql.Data.MySqlClient;" statement in every aspx.cs/aspx.vb file. How can I define this lines in web.config file?

I've defined some namespaces like below but this only works for aspx pages:

<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="false" targetFramework="4.0"/>
<pages>
<namespaces>
<add namespace="System.Web.Configuration"/>
<add namespace="MySql.Data"/>
<add namespace="MySql.Data.MySqlClient"/>
</namespaces>
</pages>
</system.web>
</configuration>

related question : Define common namespaces for code pages in Web.Config

View 3 Replies

C# - Conditional Statements Difference?

Feb 10, 2011

Is there any difference between below two statements

if (null != obj)

and

if (obj != null)

Edit: if both treated same which will be preferable?

View 7 Replies

Use Databind Records In Inline If Statements?

Mar 10, 2010

I've got a repeater on my asp.net (VB):
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("Question_Number") %>' />
<%#Eval("Question_Desc")%>

Now what I want to do is, check a value that I haven't used called "Question_Type" which could be = 1, 2 or 3 depending if it is multiple choice, short answer, etc. I have tried this:

<%
if Eval("Question_type") = 1 then
Response.Write(" <asp:RadioButton runat=""server"">test1</asp:RadioButton>")
Response.Write(" <asp:RadioButton runat=""server"">test2</asp:RadioButton>")
Response.Write(" <asp:RadioButton runat=""server"">test3</asp:RadioButton>")
end if
%>

and I get this error: Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control. HOW can I use this value in a if statement?

View 1 Replies

How To Make If Statements In Databound ListView

Apr 4, 2011

I have a ListView with many advanced controls and html tags. ListView is bound to collection of profiles when first profile in collection is current profile. current profile has few differences from other profiles ie. flash embed, js and some other stuff. I can access inside of my ListView Container.DataIndex property which gives me 0 as first item in index but i'm unable to use inline If statements like so

<% If Container.DataIndex = 0 Then %>
do stuff
<% EndIf %>

this is because i must place pound to access databound item but neither this

<%# If Container.DataIndex = 0 Then %>
do stuff
<% EndIf %>

How can i make inline If ?

View 2 Replies

ADO.NET :: Put A Right Outer Join On Linq Statements?

Aug 2, 2010

I am trying to put a Right Outer Join on Linq statements. how to put Right Outer Join on Linq.

View 1 Replies

ADO.NET :: Configure Both Select And Update Statements?

Sep 6, 2010

i would like to retrieve a value with select and perform a calculation and then save using update in the same batch code?

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved