.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How would I display negative percentage values with parenthesis?

Posted By:      Posted Date: October 01, 2010    Points: 0   Category :Sql Server
"%%.%%;(%%.%%)" doesn't work

View Complete Post

More Related Resource Links

wss2.0 update/delete/hide lookup column that does not display any values


Hi All,

I have a document library that contains a Category column that is a lookup field. This is a default column that is a required field when uploading documents to the document library. The Category column is empty and I am unable to amend, hide, make it not required or delete it.

I have gone to Modify settings and columns -> clicked on the Category field to edit, but there is no option to amend the content or delete it. I am only able to amend the Column name and Description.

Since then, I have amended the column name to eg. Category1 and created a new Category field as a lookup and linked it to the correct list.

The problem I am facing now, is that I cannot hide, delete or make the Category1 (old Category) field NOT required. Either I would like to update the original field to display the correct values or alternately hide, delete or make the column not required.

Please help.

DropDownList to display values from Two Tables - bold sub heading and normal Text

Hello I hope I am not asking simple one.  SUPPORT SERVICES<     Computing Service    Library or Data Engineering    Civil Engineering    Electrical Engineering  I have the data to display in a DropDownList control shown as above. There is a distinct category Type(example Support Services) and Category Name i.e., Computing Services. I do not want to hard code the values into DropDownList control. I like to get the data from database to display as shown in above Table. Note that Category Type should be displayed in Bold and Category Name in normal Text. Question: In order to achieve the above, 1. How many database Tables and relationships between them  2. Query the data to display in the above format in drop down 3. how should be the code behind i.e, DataTextValue and DataValueField for DropDownList. Please provide with useful code snippets or references. Thanks,

Negative values sums up incorrectly

Hello, I have calculated measure that removes negative values. Problem is the Total is summing up incorrectly. Here the script of the measure. Create Member currentcube.[Measure].[Amount2] as iif ([Measure].[Amount]>0, [Measure].[Amount], null)   Below is sample result. Customer        Amount      Amount2 A                    100            100 B                    -50             C                    100            100 D                    100            100 E                     100            100 TOTAL          &n

Display the list column values along with the search result

Hi All, i created custom Scope (to search on specific list) and i need to display all list columns on my search results.  Say i have 2 columns in the list and i have created a scope to search in only in that list. If i do a search in tat scope i would like to get the list values which fits in the search along with the columns as well. thanks jayaraja

query negative and positive values and not their boolean counterpart

Good Day Need help.. I have this simple table, CREATE TABLE [dbo].[sample] ( [id] [int] NOT NULL , [number] [int] NULL , ) ON [PRIMARY] i wanted to make a select query that would display two columns(positive, negative) the sql statement that i made: "select (sample.number > 0) as positive, (sample.number < 0) as negative from sample " what happened is that, it displays the boolean counterpart and not the value.. I wanted to show this kind of data: substitute the "False" value into 0 and "-1/true" value with the exact absolute numerical value.   |debit||credit| |   0   ||  200 | |   0   ||  57   | |   50 ||  0     |   is this possible?  

problem with dimenssion Display Values



I Have built a cube and deploy it to 2008 Olap Server.  the dimenssion data looks great .

while deploying the same cube / project to another server (2005 server) the dimenssion data

displayed ?????????????? instand of the correct value. the correct value is in hebrew language.

i check the collation in 2005 server and it support Hebrew Language.

what can be the reason to that?


perform sum of textbox values and display the total in gridview footer row textbox


i have a gridview in which i have added two textboxes .

the second textbox is placed in footer of gridview

wht i want is when the user enters values in the first textbox the total of these textboxes should be displayed in footer row.

Pls help

How to display correct values from sql table?


Hello everyone. I need help writing a snippet.

 Aim to present data base values are in between numbers that are worth the value selected earlier.

Example I have bind combobox to sql table and I have selected value from another combo.

In sql table there are values = 1001,1005,2005,3060,4008 etc..

if I chose chose number = 1000 I must to desplay in combo box only this values 1001,1005 if I chose 2000 display 2005.


display / insert values by comparing 2 columns of a table



i have a table which has the following columns 

A_ID, A_Value,A_Date,B_ID,B_Value_B_Date


i have another table as follows

A_ID,B_ID,A_Value,B_Value, Date


this is to be done 

* if A_date and B date are equal, one record shoould be entered to the TABLE 02. the values should be A_ID,B_ID,A_Value_B_Value and A_Date (since the date is equal, no problem; even can insert B_Date instead of A_Date)

* if A_Date and B_Date are different, then the following should happen

insert one record to TABLE02 as A_ID,B_ID, A_Value, 0 , A_Date

insert another record to TABLE02 as A_ID,B_ID, 0 , B_Value, B_Date


(As you can see, when the date differs we enter the single record of Table 01 into 2 recoerds in table 02. the Value column and Date column are related in such a way that when A's date is entered, the value for B should be 0 and vise versa..)


i tried having a UDF but in halfway remembered that we cannot include INSERTS in UDFs..

can anyone please explain me how can i solve this problem ??


PS: For your reference , i've sketched a diagram. please click on this link to view it for further clarifications



thanks in advance

-novicedba :)

negative sign "-" to the right of the decimal instead of parenthesis "()".

Right now my SSRS 2005 report is showing negative number like this (250.55).
I need the negative sign “-“to the right of the decimal instead of parenthesis “()” like this 250.55-
Any suggestions??

ForeignKey display values based on criteria, metadata model


I have a table with 3 columns, {id,name,display}.  ID being primary key, Name being first string in table(dynamic data will populate any dropdown's with this value, unless overridden), and Display being a bit/boolean. 

I have a custom page(Master/Detail) created making use of asp:DynamicControl and asp:DynamicField.  Several of the associated Controls/Fields are ForeignKeys.  When editing/inserting the controls use the ForeignKey FieldTemplate.  Ideally, this works great!  However, I need a little bit more control over which data items get displayed from the database(selectable values).  This seems like it should be easy, yet, I cannot get my head around it. 

OBJECTIVE: When 'display' == true, show name in list.  When 'display' == false, do not show name in list. 

QUESTION: Is there a way to handle this within the metamodel using metadata attributes, etc...?  Please advise... 



Listbox values to display data from database



I have a listbox which comprises of data " systemname" . I have a sql database table with columns ( systemname, ip, downmins,pdowntime,udowntime and reason).

On the basis of the selection from the listbox i want to display the respective records for the systemname with all columns mentioned above.

Now I need to be able to take user entry for the columns (pdowntime,udowntime and reason) from the user either through table or gridview and populate this data in the database.

Note - the listbox is getting populated from the table directly using an sql query at the backend.






How to display encrypted foreign key values?



In DD, how can I show encrypted foreign key values in a drop down list?

For example, there are order and product tables in NW database.

Let's say product names are encrypted in the product table.

In my product filter (auto-generated) in the "Orders/List.aspx", I would like to first decrypt product names and populate the drop down list.

Assumption is that symmetric encryption is used and we know how to decrypt strings.

Will decryption be something that I should do in "FilterUserControl"?

If you have done something similar, could you please share your experience?

Many thanks,

Display values only in Fact Table and Not in Dim Table?


If my Dim table as 2005,2006,2007,2008,2009 and 2010 and my Fact table only currently has 2007 and 2009,  How to I filter the rest out so they don't get selected?

Essentially, it's like an inner join I guess?


Cube Writeback with weighted allocation working strangely - creating large negative values against f




I've got a cube (2008) with 2 MGs: Actuals and Budgets.

The Budgets partition is Write-Enabled.


On Excel 2010 the user will select the Actual Date for 2010-07, and will set the Budget date to 2011.

After seeing what the YTD actual figure looks like he enters the budget for 2011.

It is supposed to take that budget figure and split it between the funds that have actuals against them (using weighting).


Here's the problem:


SSAS allocates inflated figures against those funds, and then, so that the sum of those values will equal the originally entered amount, it puts a large negative value against the first Member in the fund dimension (I experimented with this by deleting the first member in that dimension. It just allocates the negative value against the new member!).

Why isn't it just allocating the values based on the ratio that it gets from that Actuals calc?



The UPDATE statement on the trace looked like this:


UPDATE CUBE [Forecasting]
SET  (
        [Actuals Date].[Year-Quarter-Month-Day Hierarchy].[Calendar Year Month].&[2010-07]
        , [Budget Date].[Year-Quarter-Month-Day Hierarchy].[Calendar Year].&[2011]

GridView inline Master/Detail record display

This code drop is part of a smash and grab series. If you're in a rush, you can just grab this code and insert it into your application, no understanding is required. When you have some time (ya, right) you may want to review the source code.

Display data in gridview dynamicallay

I have AD domain which has 100000 users, I want to display all the users in gridview controls.Actually it is displaying users in gridview after parsing entire domain which takes around 30 min. I want to display the users while loading itself.It is continously getting user information from AD domain and getting each user details, I want to display the users information which already queried instead of waiting till getting all users information
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend