Using 3 TBLS. Want To Display Fields Frm Othr Tbls

May 21, 2008

I am using three tables.

select * from ldap_users as PL
where (emcidentitytype like '%P%')
and(ctscUserKeywords NOT LIKE '%LockedOut%')
AND(ctscUserKeywords NOT LIKE '%LockedOut%')
and emclastdayworked = ''
and (uid in(select fax from oracle_11i_user)
or uid in (select fax from ORACLE_1103_USER))

This query only display all the fields from PL.
I want to display end_date from both oracle11i and oracle1103 tables?
How would I do that?

View 10 Replies


ADVERTISEMENT

Can You Qry Sys Tbls To Find Triggers, Constrants Etc?

Jul 23, 2005

I have just been handed a HUGE dB with 100's of SP, TBLs UDF etc etc.I need to add 1000's of records from a flat file accross dozens ofrelated tbls ASAP! (You know the drill)The dB was built with a lot of Business Logic, Constraints etc.I am a Web APP developer and know a lot of TSQL and can also buildbasic triggers and some pretty complex SP and have built solid dB fromscratch but I usually handle business logic and data intergrity beforeit even gets to the dB (or at least I like to think I do).With that said there is no documentation (of course)and I need toreverse engineer this beast ASAP.I was hoping there is a way to qry the SYS tbls or some tricks to getall this info I am looking for.I use the ALT+F1 short cut on tables all the time and am looking for asolution along those lines.Any help would be great and whom ever gives me the key(s) to unlockingthis mess I will give them a free access to a New RSS Fantasy Footballsite launching this summer! If you're not into FF then you can give itto a friend or something.

View 2 Replies View Related

Delete Or Leave Msdb Tbls From Sql2k?

Apr 22, 2008

I did an in-place upgrade and I was wondering if I should get rid off tables in MSDB SQL 2005 carried over from SQL 2000?

Thanks.

View 4 Replies View Related

URGENT - Random 10 From Random 20 (2 Tbls)

Oct 14, 2004

I'm using ASP and SQL Serv 2000. What I need to get from 2 tables (company & customers) is random 10 customers from random 20 comp.
Anyone got an idea how to do this??? I've spent 2 days trying to get stored proc. or T-SQL to work, but nothing good came out of it. I can get 1 comp and 10 cust, but not a grouped list of 20 comp. w/ 10 cust. each.

Help is greatly appreciated.

View 1 Replies View Related

Front End Display Of Two Fields

Aug 17, 2007



I am doing a report which needs to display a field like
totals/percentages...

the actual data values is something like this


=(Sum(Fields!B.Value))& " / " &

(Sum(Fields!B.Value))/(sum(Fields!A.Value) + sum(Fields!B.Value)+sum(Fields!C.Value)+sum(Fields!D.Value)+sum(Fields!E.Value)+sum(Fields!F.Value))

*100



the problem is sum (fields!B.value) is an integer (sum of students) like 32

and the aggregate value in the denominator is a percentage value (0.014343443%)

I need to approximate the value to 0.014


something like this
totals/percentages... .......32/0,014 instead of 32 / 0.014343443 in the front end of the report properties


Please help
Thanks


View 2 Replies View Related

How Can I Display Different Fields In The Footer

Aug 23, 2007



Hi i have a report and i want 13 text boxes that i have in the body of the report in the Page footer.

So should i specify each textbox that i want to have in page footer or is possible for me to just call the rectangle that its sitting on.

and how can i reference a image which is been pulled by the dataset ..how should reference them..

Any help will be appreciated Regards
Karen

View 10 Replies View Related

Display 2 Fields Using SalesOrderDetail Table?

Aug 4, 2014

I'm trying to Display 2 fields using the SalesOrderDetail table.

CarrierTrackingNumber

Count the number of CarrierTrackingNumber and give alias name of “Count CarrierTrackingNumber.”

I only want to return records where the CarrierTrackingNumber has count = or greater than 2.

Below is the SQL I developed, but I'm getting this error when I try to execute: Msg 245, Level 16, State 1, Line 1

Conversion failed when converting the nvarchar value '4911-403C-98' to data type int.

SELECT
CarrierTrackingNumber,
(
SELECT
COUNT(CarrierTrackingNumber)
FROM SalesOrderDetail
WHERE CarrierTrackingNumber >= 2
) AS CountCarrierTrackingNumber
FROM
SalesOrderDetail

View 4 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

Display All The Fields In Sql Server 2005

Nov 15, 2007

I want to select all the fields from just one table
This is what i have and i am having trouble selecting all the fields
select * from ace_users
where chdata EXISTS
(select chdata, count(chserialnum)
from ace_users
group by chdata
having count(chserialnum)> 1)

Exists and IN does not work.

View 3 Replies View Related

SELECT Statement To Display Combined Fields

Oct 17, 2004

Dear All
I am trying to populate an OledbDatareader for binding to a ASP datagrid.

For this I use select statement to display combined fields in a datagrid cell.
Eg. Select (Field1+ '<br/>' + Field2 + '<br/>' + Field 3) As Address .. and so on.
But the problem is if any of the three field is null the combined field 'Address' returns as Null.
Please help me to overcome this problem.

Regards
kalanad ( beginner)

View 12 Replies View Related

Split Fields And Display Query Result

Mar 21, 2007

Hi,
I'm having a problem in spliting the fields
I need to ru the following query to join two tables and getting the output as shown.

Query:
select cusl.user_name,
pmts.bill_ref_info, pmts.payee_acid, pmts.cust_acid, pmts.txn_amt,pmts.pmt_id
from cusl, pmts
where cusl.ubp_user_id = pmts.ubp_user_id and pmts.ubp_user_id= 'testinglive'

Output:
user_name bills_ref_info payee_acid cust_acid txn_amt
SAMEER ALLA0210181#123456#Amita 378902010021095 383702070051411 1.000 16318
SAMEER BARB0GNFCOM#6788990#Vikram Kalsan 378902010021095 383702070051411 1.000 16327
SAMEER BKID0000200#378902010099678#Vikram 378902010021095 383702070051411 1.000 14031
SAMEER undefined#123456789123456#Vikram 378902010021095 383702070051411 1.000 13918


Now I need to display the second field which is a #-separated field as individual fields alongwith tghe other fields that are shown on execution of the query.
Can this be done? Please guide me on this...

View 7 Replies View Related

Display Duration Between Two Datetime Fields In 00:00 Format

Nov 12, 2007

I have a requirement to display the elapsed time between two datetime fields. What i have been able to do is datediff the dates and get the elapsed time in minutes and then i am trying to format it as HH:MM.

For example, an activity started on Nov 1 2007 08:00 and finished Nov 1 23:59, the elapsed time should be displayed as 15:59.

The other example is if the activity spans over a couple of days, it should be say 49:03.


I put the following code in the format of the textbox, but it only seems to work when the length of the minutes is greater than 1.


=IIF(Len(CStr(Fix(ReportItems!textbox11.Value/60)))= 1,

"0" + CStr(Fix(ReportItems!textbox11.Value/60)),

CStr(Fix(ReportItems!textbox11.Value/60)))

+ ":"

+ IIF(Len(CStr(Fix(ReportItems!textbox11.Value Mod 60)))= 1,

"0" + CStr(Fix(ReportItems!textbox11.Value Mod 60)),

CStr(Fix(ReportItems!textbox11.Value Mod 60)))


Have i missed something really simple or what? Any help would be much appreciated.

Alternatively, if you have a better way of doing the whole thing would like to hear from you.

Thanks in advance.

View 1 Replies View Related

Is There A Way To Select What Fields To Display On A Report From A Multi-value Parameter?

Feb 19, 2008

I am trying to figure out a way to toggle the visibility of attribute data based on a parameter. Specifically, I have a report that has many columns that an end-user may not want to see, depending on what they are using the report for. I know you can toggle visibilities on individual columns easily enough, however I want the user to be able to select which fields (at the attribute level) they want visible on the report up in the parameters, via a multi-value prompt.

Is this possible with reporting services 2005?

Thanks.

View 9 Replies View Related

Change/Add Report Fields To Display Based On The Parameter Selected

Dec 18, 2007



I have a report parameter named "Schools" which display a list of schools. For example, Alo elementary school, Balo middle school and Calo high school.

When "Alo elementary" is selected the report only display students from that school along with other assessments data fields. same goes for other schools too. But I want to display different data fields for "Calo high school" when it is selected. It is not currently possilbe becasue I am using the same template for all types of schools. There some fields only should be displayed for "Calo high school" but not for any other type of schools.

I can accomplish this by creating two separate report, one for "Calo high school" and the other for other schools. But I want to accomplish this just by creating one report. So when "Alo elementary school" is selected it displays report with certain fields and when "Calo high school" is selected then it displays same fields as "Alo elementary school" but as well as some other fields too in the report. Is this possible? Need help.

View 4 Replies View Related

How To Pull Data Into A Datagrid From The Same Table, 2 Fields, And Display Them As 1 Field In The SqlDataSource?

Jan 9, 2008

Hi, Im trying to pull data from 2 fields in the same table into a SqlDataSource that feeds into a GridView, and display them as 1 field in GridView? I have a database table that has entries of users and their friends. so
this tblFriendUser has a column called UserName and another column
called FriendUserName.
I am trying to get a list of friends for that particular user. Note
that if User1 initiated the friend request, he will be listed as
UserName and his friend as FriendUserName, but if his friend initiated
the friend request, it will be vice versa: him being the FriendUserName
and his friend the UserName. So I want the following 2 queries run and merged into
one query in order to return 2 columns only: UserFriendID & UserName, is that
possible? Is my design bad? Any suggestions/advice would help! Thanks a lot!


SELECT UserFriendID, UserName
FROM tblUserFriends
WHERE (UserName = @UserName);

SELECT UserFriendID, FriendUserName AS UserName
FROM tblUserFriends
WHERE (FriendUserName= @UserName);

View 5 Replies View Related

Reporting Services :: Display Columns When There Is No Data To Display

Apr 30, 2015

I would like to display a portion of report where there is data or no data

There is data subreport  display   

     Product Name Latex Gloves  
     Product ID      
xxxx5678

 There NO data in the subReport
 
  Product Name                          
   Product ID    

View 3 Replies View Related

Subreports: Parameter Value Dropdown Shows Sum And Count Fields But Not The Actual Data Fields.

Jan 28, 2008


I have just started using SQL Server reporting services and am stuck with creating subreports.

I have a added a sub report to the main report. When I right click on the sub report, go to properties -> Parameters, and click on the dropdown for Parameter Value, I see all Sum and Count fields but not the data fields.

For example, In the dropdownlist for the Parameter value, I see Sum(Fields!TASK_ID.Value, "AppTest"), Count(Fields!TASK_NAME.Value, "CammpTest") but not Fields!TASK_NAME.Value, Fields!TASK_ID.Value which are the fields retrieved from the dataset assigned to the subreport.

When I manually change the parameter value to Fields!TASK_ID.Value, and try to preview the report, I get Error: Subreport could not be shown. I have no idea what the underlying issue is but am guessing that it's because the field - Fields!TASK_ID.Value is not in the dropdown but am trying to link the main report and sub report with this field.

Am I missing something here? Any help is appreciated.

Thanks,
Sirisha

View 3 Replies View Related

Creating A Table In SQL Server With Fields From Other Tables And Some Fields User Defined

Feb 20, 2008

How can I create a Table whose one field will be 'tableid INT IDENTITY(1,1)' and other fields will be the fields from the table "ashu".
can this be possible in SQL Server without explicitly writing the"ashu" table's fields name.

View 8 Replies View Related

Public Overridable ReadOnly Default Property Fields() As ADODB.Fields

Jan 26, 2008

sir

I have got this error message to establish connction with recordset vb .net, Can you please rectify this

Too many arguments to 'Public Overridable ReadOnly Default Property Fields() As ADODB.Fields'

my code like this


rs = New ADODB.Recordset

rs.Open("Select * from UserLogin where userid='" & txtUserName.Text & "'", gstrDB, DB.CursorTypeEnum.adOpenStatic)


If txtUserName.Text = rs.Fields.Append(userid) Then


MsgBox("OK", MsgBoxStyle.OKOnly, "Confirmation")

End If


thanks

View 1 Replies View Related

Update Fields With Searched First Date Record Fields

Jul 23, 2005

Hello !I'm trying to update one table field with another table searched firstdate record.getting some problem.If anyone have experience similar thing or have any idea about it,please guide.Sample case is given below.Thanks in adv.T.S.Negi--Sample caseDROP TABLE TEST1DROP TABLE TEST2CREATE TABLE TEST1(CUST_CD VARCHAR(10),BOOKING_DATE DATETIME,BOOKPHONE_NO VARCHAR(10))CREATE TABLE TEST2(CUST_CD VARCHAR(10),ENTRY_DATE DATETIME,FIRSTPHONE_NO VARCHAR(10))DELETE FROM TEST1INSERT INTO TEST1 VALUES('C1',GETDATE()+5,'11111111')INSERT INTO TEST1 VALUES('C1',GETDATE()+10,'22222222')INSERT INTO TEST1 VALUES('C1',GETDATE()+15,'44444444')INSERT INTO TEST1 VALUES('C1',GETDATE()+16,'33333333')DELETE FROM TEST2INSERT INTO TEST2 VALUES('C1',GETDATE(),'')INSERT INTO TEST2 VALUES('C1',GETDATE()+2,'')INSERT INTO TEST2 VALUES('C1',GETDATE()+11,'')INSERT INTO TEST2 VALUES('C1',GETDATE()+12,'')--SELECT * FROM TEST1--SELECT * FROM TEST2/*Sample dataTEST1CUST_CD BOOKING_DATE BOOKPHONE_NOC12005-04-08 21:46:47.78011111111C12005-04-13 21:46:47.78022222222C12005-04-18 21:46:47.78044444444C12005-04-19 21:46:47.78033333333TEST2CUST_CD ENTRY_DATE FIRSTPHONE_NOC12005-04-03 21:46:47.800C12005-04-05 21:46:47.800C12005-04-14 21:46:47.800C12005-04-15 21:46:47.800DESIRED RESULTCUST_CD ENTRY_DATE FIRSTPHONE_NOC12005-04-03 21:46:47.80011111111C12005-04-05 21:46:47.80011111111C12005-04-14 21:46:47.80044444444C12005-04-15 21:46:47.80044444444*/

View 3 Replies View Related

Transact SQL :: Get One Row From Multiple Based On Fields And Also Get Sum Of Decimal Fields?

Jul 2, 2015

I am using MS SQL 2012.  I have a table that contains all the data that I need, but I need to summarize the data and also add up decimal fields while at it.  Then I need a total of those added decimal fields. My data is like this:

I have Providers, a unique ID that Providers will have multiples of, and then decimal fields. Here are my fields:

ID, provider_name, uniq_id, total_spent, total_earned

Here is sample data:

1, Harbor, A07B8, 500.00, 1200.00
2, Harbor, A07B8, 400.00, 800.00
3, Harbor, B01C8, 600.00, 700.00
4, Harbor, B01C8, 300.00, 1100,00
5, LifeLine, L01D8, 700.00, 1300.00
6, LifeLine, L01D8, 200.00, 800.00

I need the results to be just 3 lines:

Harbor, A07B8, 900.00, 2000.00
Harbor, B01C8, 900.00, 1800.00
LifeLine, L01D8, 900.00, 2100.00

But then I would need the totals for the Provider, so:

Harbor, 1800.00, 3800.00

View 3 Replies View Related

Search Multipe Fields, Compounding Fields, Like, Contains...?

Jul 20, 2005

I would like to search a table for a phrase, or for a partial phrase,eg on table product - for name or description, or name + descprition.How does one say select * from product where name + description like%phrase%or contains phraseCurrently I can get where name, or where descriotion like %phrase%,eg, where name like krups, or where description like coffee makerBut if I search for where name like %krups coffee maker% i get noresults. krups is in the name field, coffee maker is in thedescription field.Thanks,-M

View 1 Replies View Related

Update Fields With Data From Other Fields In Same Row

Jun 30, 2000

Pardon me if this question is too elementary. I am trying to create a trigger that will cause certain datafields to be updated with values from other data fields in the same row when a certain column, created specifically to fire the trigger, is updated. The purpose of this is to reduce data entry by field personnel.I think I have the create trigger statement correct, but I'm a little confused on the update statement.

In a nutshell, how can I write something like:
UPDATE "TABLENAME"
SET DATAFIELD1 = DATAFIELD2
WHERE RECORDNUMBER = (THE SAME RECORD NUMBER)

I do know that I have to ensure that sp_dboption Recursive Triggers value is set to false, thanks.

View 2 Replies View Related

Using LIKE To Find Any Of Fields In One Table In Fields Of Another

Jul 31, 2013

I have a list of items in one table and a field (pageName) in another table that may contain one of the aforementioned items somewhere within that field. There is no fixed position within the field where the itemNo may be so I can't just use SUBSTRING(pageName,2,5) in(select itemNo from tblItem).

Logically, it's like I need to combine IN and LIKE: select pageName where pageName LIKE IN %select itemNo from tblitemNo%..LIKE can only handle one comparison string.

View 5 Replies View Related

Drillthrough In Calculated Fields Enable When Drillthrough Option Is Disable In Original Fields, Is This A BUG?

Jan 21, 2008

Hi people
My users are having troubles with link to default drillthrough report when reports are exported to excel (they REALLY don't like this behavior ), so I decided set all of them disabled in report model, this work fine, but calculated field in reports has this drillthrough link.


Let me show you the situation. Entity Product has an UnitaryCost field, I set the EnableDrillthrough Property in False so when I export a report with this field, no link is shown.

But if I create in the report a calculated field Round(UnitaryCost) this field has a Drillthrough Link

Is this the standard and expected behavior? or its simply a BUG?

Have I done something wrong in my model? and in this case, How I can correct this?

regards.
Julio Diaz.

View 1 Replies View Related

How To Display This?

Dec 7, 1999

I have a table with the following structure and data

SampleTable

id name parent_id
1 Microsoft 0
2 Visual Studio 1
3 J++ 2
4 VB 2
5 C++ 2

As you can see, a record with parent_id=0 is the top level. Other levels will have a parent. I want to display the above data as below

1 Microsoft
2 Microsoft - Visual Studio
3 Microsoft - Visual Studio - J++
4 Microsoft - Visual Studio - VB
5 Microsoft - Visual Studio - C++

I tried many times with the select statement but with no luck. Do you have any ideas? Thanks,

View 1 Replies View Related

Display Another Value

Dec 5, 2011

i have a column name "Principle" and the data in this column is a dollar value. How do i write a query where when the dollar amount is <0 it displays as - and when its >0, it displays as +

View 1 Replies View Related

How Do I Display The Day Name Instead Of The Day #

Apr 6, 2004

Hi,

I created a Time Dimension and ended up with the following (as shown in the attached image). The problem is that when I go to the Day level, I see numbers e.g. 1, 2, ..., 31. Instead I want to display the Weekday Name e.g. Monday, Tueday and so on (i.e. what we get with the datename(dw,<date>) function. Right?)

However I am not sure what to change and where in order to get the desired results. Can someone kindly guide me.

Thanks.

View 2 Replies View Related

How To Display..

Apr 21, 2008

Hi,

I need to show the value of a variable with comma seperated.

For eg: I have a variable N whose value is 123456.89
I need to display it as 1,23,456.89
How i can i display this...
Please help me

Thanks in advance

View 20 Replies View Related

How To Display?

Sep 18, 2007

Hi,

I have the following stored procedure

CREATE PROCEDURE dbo.test(
@number varchar(128) output
)

as
select @number = * from fix_lvts..fix_exec_reports
where gw_instance like '%PORTWARE%'
return 0


Then I go in and execute it like this:

declare @number varchar(128)
exec dbo.test @number output
select @number

I get the following result:


T_PORTWARE_GBL

(Only one row returns).


However when I execute the sql statement below:

select gw_instance from fix_lvts..fix_exec_reports
where gw_instance like '%PORTWARE%'

which is the same one as in the stored procedure except the variable declaration it reurns me the following:

gw_instance
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL

(99028 rows of data)


Why is this hapenning?

Can anyone help me?

Thanks and Regards,
Sudip

View 2 Replies View Related

How To Display

Mar 12, 2008

Hi,

My table "Branch" contain a Field name as MassMail
it contains mail IDs a@yahoo.com;b@yahoo.com;c@yahoo.com;d@yahoo.com;e@yahoo.com

Now plz write me what is the SQL Statement for Retiveing MassMail
except one or Two Mail ID
Example : Retrive
a@yahoo.com;b@yahoo.com;d@yahoo.com;e@yahoo.com

Here c@yahoo.com is not Include

Thanks

Thanks

View 2 Replies View Related

How To Display??

Sep 18, 2007



Hi,

I have the following stored procedure

CREATE PROCEDURE dbo.test(
@number varchar(128) output
)

as
select @number = gw_instance from fix_lvts..fix_exec_reports
where gw_instance like '%PORTWARE%'
return 0


Then I go in and execute it like this:

declare @number varchar(128)
exec dbo.test @number output
select @number

I get the following result:


T_PORTWARE_GBL

(Only one row returns).


However when I execute the sql statement below:

select gw_instance from fix_lvts..fix_exec_reports
where gw_instance like '%PORTWARE%'

which is the same one as in the stored procedure except the variable declaration it reurns me the following:

gw_instance
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL
T_PORTWARE_GBL

(99028 rows of data)


Why is this hapenning?

Can anyone help me?

Thanks and Regards,
Sudip

View 2 Replies View Related

How Do I Display A Count?

Mar 15, 2007

I want to display the number of records for each state in a database.  I'm using a strongly types dataset.  In my method, I have the followingSELECT     COUNT(ID) AS iTotal, STATEFROM         membersWHERE     (Suspend = 0)GROUP BY STATEORDER BY STATEIn the code behind of my page I have          Dim mateAdapter As New WAPTableAdapters.membersTableAdapter        Dim mates As WAP.membersDataTable        Dim mate As WAP.membersRow        mates = mateAdapter.GetDataState        For Each mate In mates            Select Case mate.STATE                Case "AK"                    LabelAK.Text = mate.ID.            End Select        Next  What should LabelAK.Text = mate.ID. be for me to be able to display the number of records that have 'AK' in the state field?Diane 

View 7 Replies View Related







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