SQL Server :: Modify Selection For Fields 'glmcu' (BusinessUnit) And 'glsub' (CostCenter)?

Aug 4, 2010

I have following query (against db2/400 data base using linked server).

SET @SQLSTRING =
'SELECT * FROM OPENQUERY( AS400SRV_MSDASQL,
''SELECT
glmcu as business_unit,
SUM(CASE WHEN ((date(digits(dec(gldgj + 1900000,7,0)))) >= ''''' + CONVERT(varchar(11),@DateFrom1,121) + ''''' and (date(digits(dec(gldgj + 1900000,7,0)))) <= ''''' + CONVERT(varchar(11),@DateTo1,121) + ''''') THEN glu / 100 ELSE 0 END) AS quantity1
from VGIPRDDTA.F0911
where glmcu = '''' 1000131'''' and
(glsub = ''''00200 '''' or glsub = ''''00315 '''') and
gllt = ''''AA'''' and
gldct = ''''JE'''' and
globj = '''' '''' and
glum = ''''CY''''
group by glmcu
order by glmcu'')'

The query works fine but I need to modify my selection for fields 'glmcu' (BusinessUnit) and 'glsub' (CostCenter). Instead of hard coding the selection I will need to retrieve the selection (and grouping) from another table.

Table layout:

BusinessUnit Group CostCenter
1000131 1 00200
1000131 1 00315
1000131 1 00320
1000164 1 00200
1000164 1 00400
1000131 2 04000
1000131 2 04400

So with the above table example the query should render 3 records.

View 1 Replies


Similar Messages:

Data Controls :: Change Or Modify Values Of GridView Column Fields Before It Is Rendered

Dec 28, 2012

I have a GridView that gets populated with data from a SQL database

Now i want to replace values in my one column like so......

If category  value is a 0 then display Admin in the GridView.

If category value is 1 then display user in the GridView

category is col name in gridview and sql table

View 1 Replies

ASP.NET Enabling Form Fields Based On Radiobox Selection?

Sep 14, 2010

I currently have this working somewhat as follows aspRadioButtonList ID="leavingCert" CssClass="radio pc2 top8" RepeatDirection="Horizontal" runat="server" AutoPostBack="True" OnSelectedIndexChanged="includeDaft_CheckedChanged">"But the problem is this refreshes the page is it this possible without refreshing the page

View 1 Replies

Web Forms :: Make An HTML / ASP Page Where A User Puts In Data, Either In Text Fields Or Selection Boxes

Oct 15, 2010

I'm new to ASP.NET. I 'm trying to figure out how to make an HTML/ASP page where a user puts in data, either in text fields or selection boxes, and on clicking a submit button all of there selected data gets dropped either into a Access 97 Db or an excel spread sheet. Are there any examples out there of this? Is there a place that has already created this and I can just look and the code and figure it out for myself?

View 1 Replies

C# - Server Cannot Modify Cookies After HTTP Headers Have Been Sent?

Mar 31, 2011

I am creating a web application in C#.When my page loads I fire an asynchronous thread to process some data. Part of this processing is the updating of a cookie. However when I save the cookie to the response by System.Web.HttpContext.Current.Response.Cookies.Add(c) where c is the HttpCookie, I get the following exception:HttpException: Server cannot modify cookies after HTTP headers have been sent.

View 3 Replies

How To Modify MachineKey For Session State Server

Jul 20, 2010

I'm trying to implement a SessionState server to allow multiple web servers to share the same state. At first this will be the different dev machines, and later it'll be the different web servers in the web farm.

So far, I'm making good progress I think, but one of the requirements has me confused. In order to implement this, I need to make sure that all web servers are using the same machine key.

This is a sample MachineKey taken from my local dev machine:

[Code]....

If we have a Session State Server deployed locally, do I need to ensure that all other machines using this service (specifically, the other devs working on the same project, and then when we deploy to the web farm) have the exact same entry in their Machine.Config files?

Or do I have to somehow generate a new machine key that can apply to all the machines?

View 2 Replies

SQL Server :: Modify Stored Procedure For Blocking Injection?

Mar 22, 2011

I want to modify a Stored Procedure for blocking injection :

This is the original Stored Procedure (working fine) :

[Code]....

And this is my Stored Procedure with variables :

[Code]....

Why this is not working? I got a "Conversion from type 'DBNull' to type 'Boolean' is not valid."

View 5 Replies

MVC :: OnActionExecuted - Server Cannot Modify Cookies After HTTP Headers Have Been Sent?

Apr 1, 2011

We have a basecontroller that has both an OnActionExecuting and OnActionExecuted. Occassionally, the OnActionExecuted will throw an exception 'Server cannot modify cookies after HTTP headers have been sent.'. This doesn't happen all the time, and we can't find a pattern to it. My guess, based on searching, is that filterContext is not always the current context. Is there a way to rewrite the Cookies.Add to get the current context, always? Or is the fact that we are in the ActionExecuted mean the headers will always already have been sent and we shouldn't be doing anything like this in the executed step?

[Code]....

View 1 Replies

DataSource Controls :: Modify Column Properties In SQL Server 2008?

May 17, 2010

I create a table in SQL server 2008 and add some colume

after sometime i need to change some properties of colume

but problem come when saveing the table. Error message shown:-

Saving changes are not permitted.the changes you have made required the table to be droped and re-created .you have either made changes to a table that can't be re-created or enabled the option prevent saving changes that required the table to be re-created.

View 5 Replies

MVC :: ActionFilter For Banned Users Causes Error 'Server Cannot Modify Cookies After HTTP Headers Have?

Mar 12, 2011

I am trying to make ActionFilter which redirects banned users to /Error/NoAccess site, so I have ActionFilter:

[Code]....

Before each public class xxxxxxController : Controller I use [NoBannedUsersActionFilter]. But for example on website /Account/LogOff I have error: 'Server cannot modify cookies after HTTP headers have been sent.' and VisualStudio shows me AccountModel.css file and this method:

[Code]....

View 3 Replies

SQL Server :: Cannot Add A New Column / Unable To Modify Table.Invalid Object Name 'MSED_Logs.DatabaseLog'

Dec 8, 2010

I cannot add a new column in existing table.

I have a two tables ['ev_event_how' & 'ev_events_event_how'] has relationship between these table.

Ex:

Table: 'ev_event_how'

UID - Event[PK]

Ex:

Table: 'ev_events_event_how'

UID - Event[FK] - Desc

I want to add a one more column[IsDelete] in both table. But Sql server is not allowing to add the new column, Showing various errors like

1.cannot add a new column-Unable to modify table.Invalid object name 'MSED_Logs.DatabaseLog'

2.TITLE: Microsoft SQL Server Management Studio

User canceled out of save dialog (MS Visual Database Tools)

How can I make it add a new column in existing table?

View 4 Replies

Web Forms :: In A Selection Changed Event- How To Identify User Selection

Apr 7, 2010

I was wondering if anyone can help me work out what the user has selected in this selection changed event?his is what I have so far:

protected void rblNavigation_SelectedIndexChanged(object sender, EventArgs e)
{
string url = (GetCurrentPageName()).ToString() + "?" + Request.ServerVariables["QUERY_STRING"];

[code]...

The problem is that rblNavigation.SelectedValue is not the value that the user has selected to trigger this event. How do I get the value the user has just selected?I'm using C# and this selection event is inside my MasterPage.

View 1 Replies

SQL Server :: Row Is Lock For Update Not For Selection?

Jan 10, 2011

How to row lock in SQL Server 2005. I execute a sql for row locking and that is

SELECT *
FROM authors
WITH (HOLDLOCK, ROWLOCK)
WHERE au_id = '274-80-9391'

it work fine but in this case row is lock for update not for selection. I just want to know how to lock a row as a result another user can not see that row when issue a SQL in SQL Server. please guide me. thanks

View 3 Replies

SQL Server :: How To Check Sum Two Fields And Take 10% Of The Sum

Nov 8, 2010

I'm using sql server 2008...In my database i have a table named 'Employee' and this table contains two fields namely 'count' and 'number'.What i have to need is that ,sql query to find out ten percentage of the sum of count and number...ie; 10% sum(count+number)..

View 4 Replies

ASPxTreelist Server Side Node Selection Doesnt Work?

Feb 2, 2011

i'm trying to select/unselect aspxtreelist nodes that meet the criteria.when user click a row and it fires an event which handled by server side eventhandler.When i debug the code everthing ok.selection works but on the browser side selection remains same as before eventrised.

protected void grid_FocusedRowChanged(object sender, EventArgs e)
{
menutree.UnselectAll();

[code]...

View 1 Replies

SQL Server :: SQL - Looping Through Fields In Each Record.?

Jan 14, 2011

to loop through each field in a record to test for a value and then set a flag at the end of each record if an instance of this value occurs in any fields?I have a table where some fields values are have a *c* at the beginning of the text eg "*c* value" . What I would like to do is run a select query off the table and at the end of each record have a field called "Change Flag" and a value of "Changed" or "No Change" depending if a *c* has been encountered.

There are a number of tables to run this against all with differening numbers of fields/

View 7 Replies

SQL Server :: How To Compare 2 Image Fields

Mar 26, 2011

I tried using DATALENGTH but I couldnt do if (DATALENGTH(image1) = DATALENGTH(image2) ,1,0)

Whats the best way to compare 2 image fields?

View 4 Replies

SQL Server :: Combining Two Fields With A Group?

Oct 19, 2010

[Code]....

which is giving me

And i tried

select * from @jax

group by rep

and it did not group them. How would i bring the sum ly up with the sum? so it shows 1-10 cust,sum,sumly

View 1 Replies

Mono - Is It Possible To Modify No Longer Required Runat="server"

May 5, 2010

I know why runat="server" is currently required (ASP.NET why runat="server"), but the consensus is that it should not be required if you incorporate a simple default into the design (I agree of course).

Would it be possible to modify, extend, decompile and recreate, intercept or otherwise change the behavior of how ASP.NET parses ASPX and ASCX files so that runat="server" would no longer be required? For instance, I assume that a version of Mono could be branched to accomplish this goal.

In case specific requirements are helpful, the following highlights one design:

During parsing, when configured namespace tags are encountered (such as "asp"), default the element's runat property to "server" During parsing, when configured namespace tags are encountered (such as "asp"), if the element's runat property value is available, then that value should be used in place of the default
New page-level setting introduced (can be set in the page directive or web.config) that specifies the default runat value for a specific namespace tag

View 2 Replies

Sql Server 2005 - Modify Query "log-in User Detail Should Also Display With The Help Of Session"?

Oct 14, 2010

I am using sql server 2005. In this query i want the log-in user detail should also display but it is not displaying . modify the query so that log-in user detail should also display with the help of session[userId].tostring(); Query written by me is:

SELECT DISTINCT MUDMEMBER.PK_ID, MUDMEMBER.EMPLOYEE_ID, LKB.BANK_NAME, MUHD.SALARY_ACCOUNT_NO, MUHD.PF_NO,
MUHD.PAN_NO, MUHD.GENDER, LKD.DESIGNATION_NAME FROM M_LEADERLED MLL INNER JOIN M_USER_DETAILS MUDMEMBER ON
MLL.LED_ID = MUDMEMBER.PK_ID AND MLL.START_DATE <= Getdate() AND MLL.END_DATE > Getdate() AND MLL.LEADER_ID = '1' LEFT OUTER JOIN
M_USER_HR_DETAILS MUHD ON MUHD.FK_USER_ID = MUDMEMBER.PK_ID AND MUHD.IS_ACTIVE =1 LEFT OUTER JOIN
LK_BANKS LKB ON LKB.PK_ID = MUHD.FK_BANK_ID LEFT OUTER JOIN LK_DESIGNATION LKD ON
LKD.DESIGNATION_VALUE = MUHD.FK_DESIGNATION_VALUE AND LKD.FK_ORGANIZATION_ID = 1 AND LKD.IS_ACTIVE = 1 WHERE MUDMEMBER.ACTIVE = 1

View 1 Replies

Web Forms :: How To Programmatically Set Template Fields Label Value Two One Of Two Fields Returned In A Sqldata...

Feb 8, 2011

I have a sql data souce that returns several columns of data, and they are displayed in a DetailsView on a pretty simple vb.net page. I'm stuggling with one field though for the details view.

It's a template field, and if ClientType=1 (this value is determined else where on the page), then the label in the template field should have Text='<%# Bind("ClientName") %>', but if the ClientType = 0, then the label in the template field should have Text='<%# Bind("ClientTemporaryName") %>'

How do I tell the details view to set the text for ClientName to one or the other?


[Code]....

View 3 Replies

C# - Creating A List Of Dataset Fields And Form Fields For Easy Updating?

Feb 25, 2011

I have a relatively complex dataset (numerous tables, some with multiple records) generated from reading in an XML file. I need to connect said dataset fields to an ASP form. At the moment I'm assigning them manually, like so in the pageload:

txt_first_init.Text = formData.ds.Tables["phrmHdrKey"].Rows[0]["first_init"].ToString();
txt_last_name.Text = formData.ds.Tables["phrmHdrKey"].Rows[0]["last_name"].ToString();
ddl_pregnancy_flag.SelectedValue = formData.ds.Tables["pPhrm"].Rows[0]["pregnancy_flag"].ToString();

And conversely when it's time to submit.

formData.ds.Tables["phrmHdrKey"].Rows[0]["first_init"] = txt_first_init.Text;
formData.ds.Tables["phrmHdrKey"].Rows[0]["last_name"] = txt_last_name.Text;
formData.ds.Tables["pPhrm"].Rows[0]["pregnancy_flag"] = ddl_pregnancy_flag.SelectedValue.ToString();

I did some looking into binding the textboxes (and dropdownlists, and checkboxes, and and and...) directly, but it seemed to be too many formats to use.

So this works fine, but as the number of fields increases, those load and unload lists are going to get unwieldy.

View 1 Replies

Forms Data Controls :: Databound Fields Vs Templete Fields In A GridView?

Aug 18, 2010

I am using TempleteFields for all columns in my GridView. In that columns I am using only some fields for customization but not all.

Is there any performance issue with Databound Fields vs Templete Fields in a GridView...?

Do I need to replace the remaining columns with Databound Columns instead of TempletField columns...?

View 4 Replies

Crystal Reports :: Newly Added Fields In SP Not Visible In Fields Objects?

Jan 3, 2013

I am working on Crystal Reports 8.5 and SQL Server 2000 as backend. I have a stored procedure which has been added to the Crystal Report. So that fields are visible in the Fields object section from where i can drag and drop the fields on the report and display it. But now as they want more fields i have written two select statements for displaying required fields. But these newly added fields are not visible in the Fields object section in the Crystal Reports. I have done verify database, removed and again attached the SP but the problem is not solved.

View 1 Replies

SQL Reporting :: SQL Server Business Intelligence Skips Launch Selection Screen

Feb 17, 2010

SQL Server BIDS client 2005, when launched, displays a "Splash" screen that should allow selection of 1 of 3 apps. I am trying to get to Reporting Services but the launch skips right by and goes into Analysis Services.

View 2 Replies







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