Header In Fields With Field Value

Jan 29, 2015

I have a table returning results like this

Row1 || Row2 || ERPID || ParentID || LevelID || Category || SubCategory || DDate || publish
1 || 1 || 10152159 || 1015 || 2159 || LOCTITE || LOCTITE1 || 29/01/2015 12:10 || 0
1 || 2 || 10152134 || 1015 || 2134 || LOCTITE || LOCTITE2 || 29/01/2015 12:10 || 0
1 || 3 || 10152157 || 1015 || 2157 || LOCTITE || LOCTITE3 || 29/01/2015 12:10 || 0
2 || 1 || 10062003 || 1006 || 2003 || COMPUTER || COMPUTER1 || 29/01/2015 12:10 || 1
2 || 2 || 10062148 || 1006 || 2148 || COMPUTER || COMPUTER2 || 29/01/2015 12:10 || 1

[Code] ....

How I can make the result return like this way?

Row1 || Row2 || ERPID || ParentID || LevelID || Category || SubCategory || DDate || publish
1 || 1 || 10151015 || 1015 || 1015 || LOCTITE || || 29/01/2015 12:10 || 0
1 || 1 || 10152159 || 1015 || 2159 || LOCTITE || LOCTITE1 || 29/01/2015 12:10 || 0
1 || 2 || 10152134 || 1015 || 2134 || LOCTITE || LOCTITE2 || 29/01/2015 12:10 || 0
1 || 3 || 10152157 || 1015 || 2157 || LOCTITE || LOCTITE3 || 29/01/2015 12:10 || 0
2 || 2 || 10061006 || 1006 || 1006 || COMPUTER || || 29/01/2015 12:10 || 1
2 || 1 || 10062003 || 1006 || 2003 || COMPUTER || COMPUTER1 || 29/01/2015 12:10 || 1

[Code] ....

Here is the code I use

SELECT
DENSE_RANK() OVER (ORDER BY clroot.Ctgry1.Descr ASC) AS Row1, Row_Number() OVER (partition BY clroot.Ctgry1.Descr
ORDER BY clroot.Ctgry1.Descr, T1.Descr ASC) AS Row2, left(t1.ID,4)+right(t1.levelid,4) AS ERPID,T1.ID AS Ctgry1ID, clroot.Ctgry1.ID AS ParentID, T1.LevelID, clroot.Ctgry1.Descr AS Category, T1.Descr AS SubCategory,

[Code] .....

View 9 Replies


ADVERTISEMENT

Fields In Page Header

Aug 27, 2007

Hi guys,

I'm doing a local report which requires me to have a data field on page header(company name & address particularly). Since it is not possible to place a data field on page header, what I did was placed the field instead on the body, and then I placed a text box on the page header and then reference the data fields in the body to the textbox.

Everything looks ok, but I found out that when I try to move to another page, all the values on the header will be empty. It seems that it requires that the same data fields should exist in the body of report.

Are there any other workaround here? I just need the values on the page header persist all through out the report. BTW I'm doing a report that contains combination of fields and table, to be specific, I'm creating a resume / bio data.

Any inputs would be greatly appreciated. Thanks!

View 1 Replies View Related

Use Fields In Report Header

Dec 26, 2007



I have placed a textbox in the pageheader section of the report. In the textbox expression, I am trying to use a field . THis is an example of the expression in that textbox.

=First(Fields!ID.Value, "Jobstat")
Howver it gives an err "THE Value expression for textbox referes toa field. Fields cannot be used in page headers or page footers"..Is there any other option that I have? I need this expression/field to be a part of page header, but not table header.
Also, pl note that I have tried to place the field expression in a text box in the body of the report, and then refer to that text box in the page header or footer.However, when I do that, my expression does not appear on any pages of the report, only appears on the last page of the report.

View 5 Replies View Related

Repeating A Header With Fields From The Dataset

Mar 26, 2007

Hi,

I'm designing a report and have the requirement that the report title needs to be repeated on each page. However, the report title is dynamic, retrieved from the database, so i cannot place it in the page header (what an annoyance). The solution i first thought of was placing the title in a table, repeating the table header on each page, however the problem i'm encountering is that when i have a subreport in that table, that subreport is in one row

--> if the subreport spans across multiple pages, the header will only be shown on the first page the row where the subreport is actually in...



any thoughts anyone on a possible solution?

View 4 Replies View Related

Data Fields In Page Header - An Answer That Works ALL The Time (Not Resolved)

Jan 11, 2008

Hi

I need data fields in the page header. The report is multiple pages. I have multiple fields I need in the page header. These fields will change on each page.

I've tried everything I can find suggested on this forum. They all either don't work or work for a while. Then, as is the case today, we get a problem with a report that renders perfectly in the RS browser but when it's output to a PDF, a couple of the page headers become confused.

Why can't Microsoft provide a hack that actually works somewhere (Maybe I just can't find it)? A sticky at the top of the forum?

I'm currently using the answer supplied by NB at AeM here http://forums.microsoft.com/msdn/showpost.aspx?postid=638813&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=1 As I said it works very nicely, thanks , except for when it doesn't export properly to a PDF which is an MS issue I presume not the solutions issue.

I really need to be able to make this work before I start throwing my toys from my pram and so my boss doesn't think I'm a complete idiot. I'm sure he doesn't believe me when I say I can't put data in a report header, after all it's only the most basic of reporting functions.

Can anyone please help with a 100% solution?


Cheers


View 5 Replies View Related

Separating One Field Into Two Fields Based On A Character In The Field

Jul 20, 2005

I know there has to be a way to do this, but I've gone brain dead. Thescenario..a varchar field in a table contains a date range (i.e. June 1,2004 - June 15, 2004 or September 1, 2004 - September 30, 2004 or...). Theusers have decided thats a bad way to do this (!) so they want to split thatfield into two new fields. Everything before the space/dash ( -) goes intoa 'FromDate' field, everything after the dash/space goes into the 'ToDate'field. I've played around with STRING commands, but haven't stumbled on ityet. Any help at all would be appreciated! DTS?

View 1 Replies View Related

Include Field Value In Page Header

Mar 11, 2008

I want to include a value from my result set in the header of my report but get the "You cannot reference a field value in the page header or footer" message. Here's why I want to do it:

The report uses three parameters: Date1, Date2 and Type. If Type is set to DATES the stored proc uses dates 1 and 2 as criteria to limit the returned records. Because Dates 1 and 2 are set in the report I can use the parameters collection to get those values and include them in the title of the report. If the Type paramter is set to MONTH, dates 1 and 2 are ignored and the stored proc determines what the dates are going to be using a UDF called from within the proc. The only way I could think of to get these calculated dates back from the proc was to insert them into the temp table it creates. Cheesy, I know... but I got the dates to the result set. Problem is I can't use them for what I need. So... to make a short question very long... how can I get the values in the result set into something I can use in the header or footer?

Mike Devenney

View 3 Replies View Related

SQL Server 2008 :: Bulk Import And Create New Table Based On Header Fields Of Imported File (XLXS)

Sep 11, 2015

I have a record in an Excel format (Excel 2010) and I would like to bulk import that into SQL Server 2008 and also while importing, SQL Server will automatically create a new table based on the header fields or row of the source file.

I am not sure if SQL Server 2008 has this capabilities.

View 0 Replies View Related

SQL Server 2008 :: Field As Group Header?

Jan 29, 2015

I have a table returning results like that

Row1 ||Row2 ||ERPID||ParentID||LevelID||Category||SubCategory||DDate ||publish
1 ||1 ||10152159||1015 ||2159 ||LOCTITE ||LOCTITE1||29/01/2015 12:10||0
1 ||2 ||10152134||1015 ||2134 ||LOCTITE ||LOCTITE2||29/01/2015 12:10||0
1 ||3 ||10152157||1015 ||2157 ||LOCTITE ||LOCTITE3||29/01/2015 12:10||0
2 ||1 ||10062003||1006 ||2003 ||COMPUTER||COMPUTER1||29/01/2015 12:10||1

[code]....

But I want to look like that

Row1||Row2||ERPID||ParentID||LevelID||Category||SubCategory||DDate||publish
1||1||10151015||1015 ||1015||LOCTITE||||29/01/2015 12:10||0
1||1||10152159||1015 ||2159||LOCTITE||LOCTITE1||29/01/2015 12:10||0
1||2||10152134||1015||2134||LOCTITE||LOCTITE2||29/01/2015 12:10||0
1||3||10152157||1015||2157||LOCTITE||LOCTITE3||29/01/2015 12:10||0
2||2||10061006||1006||1006||COMPUTER||||29/01/2015 12:10||1

[code]....

View 3 Replies View Related

Hidden Field Populating Header/footer Trick Not Working

Sep 25, 2007

I'm a bit stumped at this. I have done this before a bunch of times. The difference is that this time I have two rectangles in the footer. For the each, the visibility is set to an expression which checks whether the page is page 1 or 2. If it is 1, the first rectangle is visible, if 2, the second. When I reference the hidden fields on the main area of the report via ReportItems, they come through fine on the first rectangle, but are invisible on the second. I've tried the same exact fields and every time they are visible in rectangle1, and invisible in rectangle2. What is going on here???

View 2 Replies View Related

Break One Field Into 3 Fields

Aug 27, 2003

Hello all,

I have a problem. I have the address like following:

204 east 40th street,brooklyn,ny 11229

I have to break this field into four fields:
address,city,state,zip

address should be: 204 east 40th street
city should be: brooklyn
state should be: ny and
zip should be: 11229

How would I be able to do that?

Any help will be appreciated.

Thanks in advance!!

View 3 Replies View Related

How To Split A Field Into Two Fields

Apr 14, 2006

I have the following fields in table A:

GL_ID| Date |GL_Name_VC | Amount Period_TI|Year_SI
===============================================
1000|31/12/2005 | Sales | -8,000.00 | 12 | 2005
===============================================
1000|06/01/2006 | Sales | -6,000.00 | 01 | 2006
===============================================
1000|20/01/2006 | Sales | 2,000.00 | 01 | 2006
===============================================
1000|28/01/2006 | Sales | -4,000.00 | 01 | 2006

The above database is running on Microsoft SQL Server 2000 and i would like to query
for a report that looks something as below:

Period | Date | GL_Name_VC | Debit | Credit| Net Change | Balance
===============================================
01 |01/01/2006|Opening Bal | 0 | 0 | 0 | 8,000
01 |06/01/2006|Sales | 0 | 6,000 | 0 | 0
01 |20/01/2006|Sales | 2,000 | 0 | 0 | 0
01 |28/01/2006|Sales | 0 | 4,000 | 8,000 |6,000


The formula for the above calculated fields are as below:

Opening Balance = carried forward balance from Year 2005
Debit = All positive amount
Credit = All negative amount
Net Change = Total Credit - Total Debit in Period 01
Balance = Total of Net Change + Opening Bal

Guys, hope someone out there can help me with the sql command for the above report?

View 4 Replies View Related

How To Divide A Field Into More Fields?

Apr 7, 2008

Hello,

I have a field like below which has blanks 'b';

CODE
000123'b'99999'b'RED RING

WHAT i want to do is like below?

FIELD1
000123

FIELD2
99999

FIELD3
RED RING

View 1 Replies View Related

How To Split A Field Into Two Fields

Apr 11, 2006

I have the following fields in table A:

GL_ID| Date |GL_Name_VC | Amount |Period_TI|Year_SI
===============================================================
1000|31/12/2005 | Sales | -8,000.00 | 12 | 2005
===============================================================
1000|06/01/2006 | Sales | -6,000.00 | 01 | 2006
===============================================================
1000|20/01/2006 | Sales | 2,000.00 | 01 | 2006
===============================================================
1000|28/01/2006 | Sales | -4,000.00 | 01 | 2006

The above database is running on Microsoft SQL Server 2000 and i would like to query
for a report that looks something as below:

Period | Date | GL_Name_VC | Debit | Credit| Net Change | Balance
=====================================================================
01 |01/01/2006|Opening Bal | 0 | 0 | 0 | 8,000
01 |06/01/2006|Sales | 0 | 6,000 | 0 | 0
01 |20/01/2006|Sales | 2,000 | 0 | 0 | 0
01 |28/01/2006|Sales | 0 | 4,000 | 8,000 |16,000


The formula for the above calculated fields are as below:

Opening Balance = carried forward balance from Year 2005
Debit = All positive amount
Credit = All negative amount
Net Change = Total Credit - Total Debit in Period 01
Balance = Total of Net Change + Opening Bal

Guys, hope someone out there can help me with the sql command for the above report?

View 2 Replies View Related

Two Int Fields Or One Varchar Field

Jul 20, 2005

I am setting up a database that will receive a lot of data from twoseparate telephone centers, the log table will in a short time haveover 1 million lines, and I was wondering if I should use 1 identifyfield or two:case 1:[Id] [int] IDENTITY (1, 1) NOT NULL[ServerId] [int] NOT NULLcase 2:[Id] [varchar(20)] IDENTITY NOT NULLWhere in case 1 I would just use a combination of Id and ServerId toidentify the line, where in case 2 I would have the Id field a varcharthat would look something like A-000001, A-000002 for server 1 andB-000001, B-000002 for server 2Which solution will be faster when searching for a record when thewill have over 1 million lines?

View 3 Replies View Related

Same Field From Several To Seperate Fields Of A Single Row

Nov 11, 2007

Hi,


I'm struggling with this. I'd like to perform a joined query
from two or more tables and take the same field from several
rows of one table into seperate fields of a single row in a new table.

Like this:



table 1

uidunameuloc
1mehere
1methere
2youhere
2 youthere


table 2

uidulocuparam#uparamval
1here1a
1here2b
1here3c
1there1d
1there2e
1there3f
2here1g
2here2h
2here3i
2there1j
2there2k
2there3l


result in table 3

uidunameuloc uparval1 uparval2 uparval3
1mehere a b c
1methere d e f
2youhere g h i
2 youthere j k l



uparam# field in table 2 always the same sequence


Any ideas????


Thanks...

View 2 Replies View Related

Updating A Field With Info From Other Fields

May 8, 2008

I am trying to make a field that has info from othe fields

Table = Page0
Fields = LName, FName, SS

I want a new field (Folder) to be all three fields.. for example
LName= Smith
FName= John
SS= 1234

I want to update Folder = Smith_John_1234

View 5 Replies View Related

Combine Column Fields Together Into One Field

Jan 24, 2007

Hello to All,

I needs help to combine these together but how would I eliminate necessarily zero in front of "PropertyHouseNumber".


Table: DirectHome

Column fields.......
PropertyHouseNumber, PropertyStreetDirection, PropertyStreetName, PropertyMODE

0000001091 , W , 000026TH , RD


Thank you


RV

View 5 Replies View Related

Display All Fields Including The Field Has Dup

Nov 14, 2007

I have one table where i want to use aggregate function for duplicate rows and also be able to select all fields to display. How would i do that?

Here is my query:

select Z, count(*)as num from Table
group by Z
having count(Z) > 1 ----- this returns 213 rows

Select Z, A,B,C,D From Table
Group By Z, A,B,C,D
Having Count(Z)>1 ----This gives me nothing

Hope I am explaining this correctly as to what I want.

Thanks,
Saru Brochu

View 3 Replies View Related

Non-existing Field In Fields Collection

Apr 11, 2007

I'm developing a report in RS 2000 that uses two datasets. The first dataset provides data to a drill-down report on the top part of the screen and the second small dataset provides some data for additional summary information on the bottom of the screen. I'm getting a runtime error "An unexpected error occurred in Report Processing. The expression referenced a non-existing field in the fields collection." Of course, I've edited every expression I can think of: text boxes, data grid, parameters, filters, drill-down lists... I think I've gone through every object on the report but I can't isolate the bad expression. Can anyone suggest a better way to debug this type of error? It compiles fine, but fails in runtime. thanks.

View 1 Replies View Related

Joining Two Fields To Single Field

Jun 14, 2006

If I have a database table with the following columns:
ID
Other_ID
Description

And I want to join the two ID fields to one field in another table that contains the following fields:
ID
Name

How would i do that?

Here is some sample data and what I would like returned

TABLE1

ID Other_ID Description
row 1 1 2 Number1
row 2 3 1 Number2

TABLE2

ID Name
row 1 1 John
row 2 2 Bob
row 3 3 Bill

I want to query TABLE1, row 1 so that I pull back the Names for the values stored in the ID and Other_ID fields so that my results are like:
John Bob Number1

The only way around it now is that I store Other_Name in Table1.

Thanks.



View 4 Replies View Related

Update Field Based Upon Other Fields

Jan 24, 2008



Hi,

I have a table with eight (8) fields, including the primary key (rfpid). Three of the fields are foreign keys, which take their values form lookup tables. They are int fields (pmid, sectorid, officeid). One of the fields in this table is based on putting together the descriptive field in the lookup table for sector (tblsector). The two other fields to be part of this string are the rfpname and rfpid. This creates the following string:

rfpsector_nameproposalscurrent_year
fpname_08_rfpid


NOTE:


The words rfp, proposals are words that have to be part of string;

the slashes are to also appear.

current_year would be defaulting to datepart = year (2008)

The part that has the last two digits of the current year then the underscore and then the rfpid should be connected by an underscore to the rfpname.
I am at a loss and would greatly appreciate any help.

Thanks

View 51 Replies View Related

Select Fields Based On The Value In A Field

Sep 2, 2015

I have a table with two sets of fields, one for PRIMARY Mail Address and the other for ALTERNATE Mail Address. Both sets are five fields long.  I will call them PRIMARY & ALTERNATE for this discussion.  I want to select the PRIMARY fields if ALTERNATE is either null or zero, and the ALTERNATE fields if data is present.

I have used this syntax but it gives a table with both the PRIMARY & SECONDARY records.

SELECT    TXPRCL, TXALTR, TXANAM
FROM    dbo.PCWEBF21
WHERE    (TXALTR > 0)
UNION
SELECT    TXPRCL, TXTAXP, TXTNAM
FROM    dbo.PCWEBF21
WHERE    TXALTR = 0

Would a Select Case work? something like

Select PRIMARY when ALTERNATE = 0, and ALTERNATE when ALTERNATE > 0 or is not null.

View 17 Replies View Related

Join Several Fields To Create New Field

Oct 4, 2006

What would be the recommendation/approach in creating a seperate field in which joins several differate fields together.



I have a table with field name a, b, and c. I want the information in those fields to be populated in a seperate field, d.



So instead of:



a

122

b

joe

c

st



I would have:

d

122 joe st



Thanks!

View 12 Replies View Related

How To Concate 2 Ore More Text Fields Into One Field?

Oct 12, 2006

Hello,

I hope someone has already done this, but I have a table with a text column- example ColA, now i want to run a query to select the ColA in this table and combine the results of ColA into a ColB in another table.

Something like - Note: the codes below doesn't work!!

DECLARE @ResultID as int
DECLARE @AccID int
DECLARE _rows CURSOR
FOR SELECT AccID FROM tableA

FETCH NEXT FROM _rows INTO @AccID

WHILE (@@fetch_status <> -1)
BEGIN

UPDATE TableB SET Report = Report + (SELECT txtField FROM tableA WHERE AccID = @AccID)

WHERE AccID = @AccID


FETCH NEXT FROM _rows INTO @AccID

END

Thanks in advance



View 8 Replies View Related

Displaying Two Fields In One Field When They Are Seperate Datatypes

Jan 16, 2008

Hi All.
I apologise if i have not posted this in the correct Topic before i start. But was uncertain where to post this query.
This is my first project in ASP.NET, MS Visual Web Developer 2005 Express and SQL Server 2005 Express. I have relatively little experience, so please bare with me. I have the table below:-
Column Name                 Data Type
OrderID                           intOrderNo                          intInvoiceNo                        varchar(50)PurchaseDate                 smalldatetimeCost                               moneyInsure                             money
I wish to have a dropdownlist on an aspx page display the OrderNo and the Cost e.g. 12345 £3.50. I have tried the SQL Statement below but that just calculates the addition of both.
SELECT OrderNo + ' ' + Cost AS Expr1
FROM [Order]
Do i have to convert them both to string/varchar first? If so, how?
Thanks for your replies.

View 3 Replies View Related

Concatenating Three Longint Fields Into A Date Field

Apr 20, 2001

Good afternoon one and all,

I have the following problem that I can use some help with :

I have a table in a linked server that has the date stored in three fields (i.e. day,month and year (I have no idea why)). I would like to concatenate these three fields together into a datetime format in a SQL statement

Something like

SELECT ([stc_dd] & '/' & [stc_mm] & '/' & [stc_yy]) AS stkdate

(the above line does not work)

Hope that is clear, thanx in advance for any and all help

Gurmi

View 1 Replies View Related

Parsing A Field Data And Populating Other Fields

Nov 3, 1999

I have just started to look at SQL and have a theory question that I could apply to a test I want to run. I have some legacy data from a previous project and the database was not designed properly (in my opinion). They have ONE field to capture City and State information. All the data is formatted City, State .

Does SQL have commands that can look at data in a field, strip out info before and info after a comma and then write that to other fields?

So, I would like to normalize this to take the data in a field called CityState and parse it, trim it and then populate two new fields 1) City and 2) State.

Thanks for your help!
Scott

View 1 Replies View Related

Changing One Field Updates 3 Other Fields, Use A Join?

May 10, 2004

i currently have a table like this..


user_id username app_id app2_id app3_id app4_id
1 john 3 4 5 6
2 mike 4 5 6 6
3 manager 4 5 6 6
4 vicepres 5 6 6 6
5 ceo 6 6 6 6
6 board 6 6 6 6


the basic pattern is... a user has approvers, and those approvers have approvers as well... i have 4 columns of approvers.. and if my first approver is the manager, then my second approver will be the managers approver and my third approver will be the managers approver's approver and so on..

on my actual page, i have select fields for the app, app2, app3, app4 and i need it so that when i change the very first app, it'll automatically update app2, app3, and app4

any ideas how i would do this? im pretty new to sql but im thinking i would use some type of join?

thanks

View 7 Replies View Related

T-SQL (SS2K8) :: Parsing Text Field Into 4 Fields

Sep 5, 2014

I have a text field that I need to parse out into 4 fields.

30.125x23.625-18.875x25.375
6.1875X19.375-2.4375x15.625
0X0-0x0
26.875X11.375-11.125x22.875
0X0-0x0
0X0-0x0
6.1875X26.875-2.4375x23.125
6.1875X26.875-2.4375x23.125
6.1875X26.875-2.4375x23.125
26.625X14.875-11.125x22.875
26.625X14.875-11.125x22.875

I need to 26.625X14.875-11.125x22.875 should be 26.625 then 14.875 then 11.125 then 22.875

View 5 Replies View Related

Update Fields Using Data In Existing Field?

Jan 15, 2015

I have a field where all of the data is 5 characters in length. The last character denotes a status and will always be an F, H, or T. I want to add a new field (which I will do manually) and populate the new field with the last character from the "old" field. Once that is complete, I want to eliminate that 5th character from the old field.

OLD FIELDNEW FIELD
B123F
B123H
B123T

OLD FIELDNEW FIELD
B123F
B123H
B123T

View 2 Replies View Related

JOINing On CHAR Fields Of Different Field Lengths

Nov 30, 2007

Can someone comment on why joining two tables on CHAR fields of different lengths would generate unexpected results?

I had an issue where I ran an update that used an inner join on two tables. The field I used in the join was char(50) in one table and char(13) in another table. The result gave bad matches. After changing the field types both to varchar(30), the problem was eliminate.

Any comments on this would be appreciated.



Rye Guy

View 3 Replies View Related

Transact SQL :: Use Field Alias In Calculated Fields?

Jul 18, 2015

use Northwind
Go
select 
dbo.Orders.OrderID
,Cast(dbo.Orders.OrderDate As DATE)Order_Date 
, dbo.Customers.CustomerID 
, dbo.Customers.CompanyName 
, dbo.Products.ProductName

[code].....

I cannot use the alias field names as part of additional calculations for new columns. 

total_Amount and  Grand_Total cannot be done with my skill level.

View 9 Replies View Related







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