Page 2 - Trying To Get - List Of Brokers With One Case Only In Last 9 Months

Feb 28, 2007

Well I agree with you about "Order By" having no value in the subquery, its a silly slip from clarity caused after ordering the subquery when it was run in isolation as an individual query to verify the dataset. However removing the ORDER BY from the subquery allows the removal of TOP from the subquery but not the highest level query as I need to keep some order in the madness.

Quote: Originally Posted by r937 ORDER BY makes absolutely no sense in a subquery

take it out and i'll bet EM doesn't stick TOP 100 PERCENT in there any more

what it's trying to do is overcome the silliness of ORDER BY in a subquery with its own silliness

kind of like acid/base, yin/yang, ...

View 1 Replies


ADVERTISEMENT

Trying To Get - List Of Brokers With One Case Only In Last 9 Months

Feb 27, 2007

I have a problem where I need to return a list of Brokers that have had only one case and that case was in the last nine months, the script below was returning appropriate numbers until I amended it to add the date of that case (cdateReceived) and the related join.

There were 470 rows returned before the addition of the cdateReceived and 1780 rows after. Ordinarily you would expect the dataset to grow with the addition of a join on a one-to-many realtionship but the criteria should be limiting the resuilts to be brokers with only one case!!! It should not then increase the number of rows.

What am I mis-understanding?

SELECT TOP 100 PERCENT
dbo.brokerDetails.bFirstname + ' ' + dbo.brokerDetails.bSurname AS Broker,
dbo.brokerCompany.companyName,
dbo.brokerCompany.cTown,
dbo.brokerCompany.cPostCode,
ISNULL(dbo.brokerParent.pName, 'DIRECTLY AUTHORISED') AS Network,
dbo.cases.cDateReceived

FROM dbo.brokerDetails INNER JOIN
dbo.brokerCompany ON dbo.brokerDetails.bCompany = dbo.brokerCompany.companyID LEFT OUTER JOIN
dbo.brokerParent ON dbo.brokerCompany.cNetworkID = dbo.brokerParent.parentID INNER JOIN
dbo.cases ON dbo.brokerDetails.BrokerID = dbo.cases.BrokerID
WHERE (dbo.brokerDetails.brokerID IN
(SELECT TOP 100 PERCENT brokerID
FROM dbo.cases
WHERE (cDateReceived < DATEADD(mm, - 9, GETDATE())) AND (Spiked = 0) AND (IsDirect = 0)

GROUP BY brokerID
ORDER BY brokerID
)
)
AND (dbo.brokerDetails.brokerID IN
(SELECT TOP 100 PERCENT brokerID
FROM dbo.cases
WHERE (spiked <> 1) AND (IsDirect = 0)
GROUP BY brokerID
HAVING count(caseID) =1
ORDER BY brokerID
)
)
ORDER BY dbo.brokerDetails.bFirstname + ' ' + dbo.brokerDetails.bSurname

View 14 Replies View Related

Trying To Get - List Of Brokers With One Case Only In Last 9 Months

Feb 27, 2007

I have a problem where I need to return a list of Brokers that have had only one case and that case was in the last nine months, the script below was returning appropriate numbers until I amended it to add the date of that case (cdateReceived) and the related join.

There were 470 rows returned before the addition of the cdateReceived and 1780 rows after. Ordinarily you would expect the dataset to grow with the addition of a join on a one-to-many realtionship but the criteria should be limiting the resuilts to be brokers with only one case!!! It should not then increase the number of rows.

What am I mis-understanding?

SELECT TOP 100 PERCENT
dbo.brokerDetails.bFirstname + ' ' + dbo.brokerDetails.bSurname AS Broker,
dbo.brokerCompany.companyName,
dbo.brokerCompany.cTown,
dbo.brokerCompany.cPostCode,
ISNULL(dbo.brokerParent.pName, 'DIRECTLY AUTHORISED') AS Network,
dbo.cases.cDateReceived

FROM dbo.brokerDetails INNER JOIN
dbo.brokerCompany ON dbo.brokerDetails.bCompany = dbo.brokerCompany.companyID LEFT OUTER JOIN
dbo.brokerParent ON dbo.brokerCompany.cNetworkID = dbo.brokerParent.parentID INNER JOIN
dbo.cases ON dbo.brokerDetails.BrokerID = dbo.cases.BrokerID
WHERE (dbo.brokerDetails.brokerID IN
(SELECT TOP 100 PERCENT brokerID
FROM dbo.cases
WHERE (cDateReceived < DATEADD(mm, - 9, GETDATE())) AND (Spiked = 0) AND (IsDirect = 0)

GROUP BY brokerID
ORDER BY brokerID
)
)
AND (dbo.brokerDetails.brokerID IN
(SELECT TOP 100 PERCENT brokerID
FROM dbo.cases
WHERE (spiked <> 1) AND (IsDirect = 0)
GROUP BY brokerID
HAVING count(caseID) =1
ORDER BY brokerID
)
)
ORDER BY dbo.brokerDetails.bFirstname + ' ' + dbo.brokerDetails.bSurname

View 14 Replies View Related

Power Pivot :: Date Dimension - Create A List Of Months

Jul 21, 2015

I need to create a date dimension where the lowest level is month. I've seen examples which use the list function such as

Source = List.Dates(#date(2000, 1, 1), Duration.Days(DateTime.Date(DateTime.FixedLocalNow())-#date(2000,1,1)), #duration(1,0,0,0)),

The above increments by 1 day which is defined in the 1st argument of the #duration. My question is how can I dynamically change the value of this 1st argument such that its the number of days in the current month hence it will increment to only return the 1st date in the Month e.g

1/1/2000
1/2/2000
1/3/2000
etc..

I prefer to use an elegant approach if possible, the alternative would be return all dates, create a custom column from these dates which returns the month date - delete the dates column - get a distinct list of the month dates.

View 2 Replies View Related

Communication Between Two Service Brokers

Aug 2, 2007

I am trying to setup an alert system for our new application. Idea is to create triggers on the tables that we need updates about. When a table changes trigger will be fired and that will send a change data message to a service on a
different sql server. That service will process the message and create an event in the notification services database. Notification service will later send an email or sms etc depeding on what is required.

Currently i got the message exchange working between two service in the same database. Now I am working on exchanging message between two SQL Servers with no luck. Can anyone please post an article on how to setup communications between two services on different servers.

I did try to expose service broker as an endpoint and create a route on the other server to call it? (This don't work)


Thanks,
Fahad

View 3 Replies View Related

List Box Page Number

Jul 3, 2007

Hello,



I have a matrix inside a list box that groups by "question id" to display matrices with summaries for each question. I have checked the box "Insert page break after this list".



I want to be able to place the list box number next to the question, so that I will see something like:



1. Name

2. Category

3. Age



Is there a way to do this? Can I access the current number within the list? If I try the Globals!PageNumber variable, I get an error saying that the variable can only be used in a header or footer.



Thanks,



Michael

View 3 Replies View Related

List Page OverRun

Dec 26, 2006

Hi

Is it possible to set a list control not to grow? I have multiple tables in a list box and text boxes it is grouped by a particular column it possible to say that if it the list has to steach to the next page because to much information is to display just don€™t go over to the next page just hide it or don€™t display the rest of the records

View 2 Replies View Related

List All SQL/VS.NET Objects On An Aspx Page?

Mar 4, 2005

Hi guys,

Being new to ASP.NET, I may be asking something that is dead simple, but please bear with me!

How would I go about listing all the tables, stored procedures and views from a SQL database within an aspx page? I understand how to connect and return a dataset etc, but that's about as far as I can get. I want to be able to list all of these objects from a given db - any ideas?

Additionally (this may not be possible) - is there a way I can list all of the objects within a visual studio.net solution, again within an aspx page?

Thanks for any help,

Jon

View 2 Replies View Related

Lists: Can't Get A Header To Appear For Each Page Of My List

Apr 16, 2008



I want to display a phone directory by department.

I created a list and told it to group on department and then I put a table in the list that had PhoneNo, EmployeeName as the columns.

Now the list works in that it seperates that table out by department (so 5 departments means 5 instances of the table with a text box above the table but inside the list with DepartmentName.Value).

The problem though is that text box only appears once for each table, the first time the table is generated. I can't get the department name to display at the start of each page.

Do I need another sublist or something, how can I get the department name textbox to appear at the start of each page for my list?

So what I have is:
DEPARTMENT NAME: Sales
---(table starts here)
.............5555...Smith
.............lots more names.......
- - - - - - - - - - - - - - - PAGE BREAK - - - - - - - - - -
---(table continues on from last page...)
.............4444...Johnson
.............3246...Benson
---(table ends here)
------------------------------------new iteration of this, so the next department is IT and this all repeats again

What I want to get is:

DEPARTMENT NAME: Sales
---(table starts here)
.............5555...Smith
.............lots more names.......
- - - - - - - - - - - - - - - PAGE BREAK - - - - - - - - - -
DEPARTMENT NAME: Sales (this is repeated as it is the start of a new page, in a perfect world I'd be able to even say "Continued..." after the department name on all pages that were not the first page it appeared)
---(table continues on from last page...)
.............4444...Johnson
.............3246...Benson
---(table ends here)
------------------------------------new iteration of this, so the next department is IT and this all repeats again with department name at the start of each and every page

View 1 Replies View Related

Duplicate A Same List On The Every Page (important)

Feb 20, 2008

Hi everyone, I have a question. We need to create a server report to display a one product's information at the left (datasource with a one ID of selected product) and other products to compare at the right (second datasource with N of IDs of products to compare). The problem is how to duplicate the first List element with selected product on the every page (by default it renders only on the first page)? Any ideas?

View 3 Replies View Related

Dynamic CASE Statement Based On List Of Dates

Oct 5, 2007

I have the following table of data.  I need to take a date from a large table and do the following case:CASEWhen date < date(0)     Then '0'When date between date(0) and date(1)      Then '1'When date between date(1) and date(2)     Then '2'When date >= date(3)      Then '3'What I need is to be able to read all the dates the the Date table, sort then chronologically, and build the dynamic CASE statement so that the first When statement is < Date(0) and the last When statement is >= Date(Last)I hope I am making sense.  Dates will be added to the table about once a year or so and I don't want to keep going back into the sql function and rewrite it with the latest date.  Any ideas how to manipulate these dates into a case statement?  Don't worry about the second table below.  I just wanted you to see why I need to return an int from the Case function.thanksMilton



Dates Table

Date

4/1/2003

1/1/2006

4/2/2007

Fee Table



Date
Period
Class
Fee

1
Daily
True
329

1
Half Day
True
178

1
OT
True
49

1
Hourly
True
41

1
Daily
False
156

1
Half Day
False
86

1
OT
False
27

1
Hourly
False
19

2
Daily
True
355

2
Half Day
True
192

2
OT
True
50

2
Hourly
True
44

2
Daily
False
171

2
Half Day
False
92

2
OT
False
28

2
Hourly
False
21

3
Daily
True
364

3
Half Day
True
197

3
OT
True
51

3
Hourly
True
45

3
Daily
False
175

3
Half Day
False
94

3
OT
False
29

3
Hourly
False
21

View 3 Replies View Related

Trying To Use The Results Of A Case Statement In My Select List In My WHERE Clause?

Aug 10, 2006

I am fairly new with SQL and still learning. I have used a case statemtent for a column in my select list and want to use the results of that statement's field in my WHERE clause but it is not working for me. Here is the code I have so far:

SELECT
l.loanid,
p.investorid,
l.duedate,
case when pc.duedate >= l.duedate then pc.duedate end as RateDueDate,
pc.interestrate
FROM loan l
inner join participation p on p.loanid = l.loanid
inner join paymentchange pc on pc.loanid = l.loanid
where p.investorid = '12345' and RateDueDate is not null
order by l.loanid, pc.duedate

I want to put the results of this case statment in my where clause like highlighted above but it is not working because RateDueDate is not an actual column in the table. Any help would be greatly appreciated.

Thanks!

View 6 Replies View Related

Problem With Group By When Using Case Statements In The Select List.

Oct 11, 2007



I am using SQL Server 2005 and fairly new at using SQL Server. I am having problems using a Case statements in the select list while have a group by line. The SQL will parse successfully but when I try to execute the statement I get the following error twice :

Column 'dbo.REDEMPTIONHISTORY.QUANTITY' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.



Below is the my sql statement:

SELECT dbo.DateOnly(TH.TransactionDate) AS RptDate, RH.Item,

ItemRef =

Case

when RH.Quantity < 0 then Sum(RH.Quantity)

when RH.Quantity >= 0 then Sum(0)

end

FROM dbo.RHISTORY AS RH INNER JOIN
dbo.TRANSHISTORY AS TH ON RH.TRANSACTIONID = TH.TransactionID

WHERE (dbo.DateOnly(TH.TransactionDate) BETWEEN '10-1-2007' AND '10-5-2007')
AND (RH.TransactionCode IN (13, 14, 15, 16))

Group by dbo.DateOnly(TH.TransactionDate), RH.Item

The TransHistory table contains, primary key transactionid, TransactionDate and the RHistory contains all the details about the transaction, the RHistory table is joined to the TransHistory table by foreign key TransactionID. I am trying to get totals for same item on the same day.

Any help will be greatly appreciated. I am also having trouble using If..Then statements in a select list and can not fin the correct syntax to use for that.

View 12 Replies View Related

List Causes Adobe To Leave Blank Page When Exporting

Jan 11, 2008

Hi,

My report page settings are as follows

page width 28cm
page height 21cm

all margins 1cm

My report when rendered to the screen outputs the correct number off pages...HOWEVER when i export it to adobe i get a trailing blank page which accompanies each page break.

Can anyone please help ?

My report has a table which is bounded to a list with separate fields at the top of the list specifying the username in a text field and the table displays the user details, For each user there is a page break.

I have notice when i got rid off the list everything is ok, however the list seems to be within the boundaries of the report

View 5 Replies View Related

Matrix Page Breaks Within A List / Visibility Is Conditional

Aug 13, 2007

Think I have found a bug.

I have a report that has a Parameter called "LevelOfDetail" This has 2 possible values "Summary, Detail, or Combined".

The report has a Summary Section and a subreport that holds the details.
WIthin the summary section is a Matrix (a list of all properties and some values)

If they choose to see the details, the matrix in the details section will show a break out of all this information summarized in the summary section.

The Details Matrix is set to have a page break at the beginning and end of the top level group.

I have a list control on the summary page that contains the details subreport and passes the appropriate parameter.

Everything works the way I want until I try to set visibility on sub report.

Once I set the conditional visibility of the report objects (based on the Level of Detail parameter) the page breaks are not recognized.

This is important as the user will never print the report, but will be downloading to Excel.

If the page breaks work correctly, each page is assigned a different worksheet in their downloaded workbook.

Any help, please let me know.

View 1 Replies View Related

Selecting Data Within 1 Month, 6 Months, 12 Months

Mar 27, 2008



I have the following table



FeedBack Type Date

test2 positive 03/15/08

tes3 negative 03/01/08

.. ....



in my page i need to select the number of negative/positive comments within the last



1 month, 6 months, 12 months



How can I accomplish that?
thanks

View 5 Replies View Related

Matrix Reports Spawn Extra Page - Enclosing In List Fixes This.

Apr 20, 2007

We really like using the Matrix reports, but we were finding that every Matrix report that we created would spawn an extraneous blank page. We tried putting the matrix in a rectangle, which works well for positioning other items on reports, but this had no effect on the problem.



Then we tried placing the matrix in a list with the list group details set to "=Nothing". It worked great - no more extra pages. Looked and didn't see this tip mentioned elsewhere so thought it might be worth sharing.

View 1 Replies View Related

SQL Server 2008 :: Does List Of Page IDs Allocated For A Table Change During Index Rebuilds

Jul 16, 2015

We noticed a deadlock 3-4 weeks ago on a table (table1) and deadlock graph was captured.

When I am analyzing the deadlock graph, page number using DBCC PAGE, I am getting the object id for a different table (table2). But deadlock graph shows the name of the object as table1.

Is it possible that subsequent defragmentation of indexes would have caused the respective page id to got re-allocated to a different table? I checked the deadlock graph lately only after 3-4 weeks.

View 1 Replies View Related

Reporting Services :: How To Display Fixed Number Of Rows In Page Wise Using List

Sep 10, 2015

i want to break 2 by 2 rows in reportceiling(rownumber(nothing)/2).i used this expression in row group. URL....but i want to use this expression in matrix and that matirx is with in list . so i  am getting error . how to use rownumber in list.here i used list to break the page wise id

View 3 Replies View Related

Reporting Services :: All Record Are Displaying On One Page - How To Display Page By Page

Nov 11, 2015

I have created one reports but all the records are displaying on one page.find a solution to display the records page by page. I created the same report without group so the records are displaying in page by page.

View 3 Replies View Related

I Need To Pass Data Entered /created On The First Page To The Next Page And Populate The Next Page With Some Data From The Fir

Nov 28, 2006

Hello I have a project that uses a large number of MS Data access pages created in Access 2003 and runs on MS SQL2005.

When I am on lets say my client, (first page in a series) data access page and I have completed the fields in the (DAP), I am directing my users to the next step of the registration process by means of a hyperlink to another Data access page in the same web but in a linked or sometimes different table.


I need to pass data entered /created on the first page to the next page and populate the next page with some data from the first page / table. (like staying on the client name and ID when i go to the next page)


I also need the first data access page to open and display a blank or new record. Not an existing record. I will also be looking to creata a drop down box as a record selector.


Any pointers in the right direction would be appreciated.
I am some what new to data access pages so a walk through would be nice but anything you got is welcome. Thanks Peter€¦

View 2 Replies View Related

SQL Server 2008 :: Change Text Format From Case Sensitive To Case Insensitive?

Aug 31, 2015

How can I change my T-SQL text editor from text sensitive to text insensitive?

View 2 Replies View Related

Case Insensitivity Is On Server Wide: Tables Render Case Sensative...

Jan 6, 2005

Hello:

I have created an SQL server table in the past on a server that was all case sensative. Over time I found out that switching to a server that is not case sensative still caused my data to become case sensative. I read an article that said you should rebuild your master database then re-create your tables. So after rebuilding the master database, a basic restore would not be sufficient? I would have to go and manually re-create every single table again?

Any suggestions?

View 4 Replies View Related

Case Insensitive Searching In Sql Server 2000 When It's Case Sensitive

May 4, 2007

Can someone point me to a tutorial on how to search against a SQL Server 2000 using a case insensitive search when SQL Server 2000 is a case sensitive installation?
 
thanks in advance.

View 3 Replies View Related

SQL 2012 :: List All Different Values That Go With Single CAS ID To Appear As Comma Separate List

Jun 15, 2015

So at the moment, I don't have a function by the name CONCATENATE. What I like to do is to list all those different values that go with a single CASE_ID to appear as a a comma separate list. You might have a better way of doing without even writing a function

So the output would look like :

CASE_ID VARIABLE
=====================
1 [ABC],[HDR],[GHHHHH]
2 [ABCSS],[CCHDR],[XXGHHVVVHHH],[KKKJU],[KLK]

SELECT
preop.Case_ID,
dbo.Concatenate( '[' + CAST(preop.value_text AS VARCHAR) + ']' ) as variable
FROM
dbo.TBL_Preop preop
WHERE
preop.Deleted_CD = 0

GROUP BY
preop.Case_ID

View 8 Replies View Related

HELP! Case Insensitive Database On Case Sensitive Server

Aug 17, 2005

We need to install CI database on CS server, and there are some issueswith stored procedures.Database works and have CI collation (Polish_CI_AS). Server hascoresponding CS collation (Polish_CS_AS). Most queries and proceduresworks but some does not :-(We have table Customer which contains field CustomerID.Query "SELECT CUSTOMERID FROM CUSTOMER" works OK regardless ofcharacter case (we have table Customer not CUSTOMER)Following TSQL generate error message that must declare variable @id(in lowercase)DECLARE @ID INT (here @ID in uppercase)SELECT @id=CustomerID FROM Customer WHERE .... (here @id in lowercase)I know @ID is not equal to @id in CS, but database is CI and tablenames Customer and CUSTOMER both works. This does not work forvariables.I suppose it is tempdb collation problem (CS like a server collationis). I tried a property "Identifier Case Sensitivity" for myconnection, but it is read only and have value 8 (Mixed) by default -this is OK I think.DO I MISS SOMETHING ????

View 4 Replies View Related

Doing A Case-sensitive Query In A Case-insensitive Database

May 29, 2008

I am working in a SQL server database that is configured to be case-insensetive but I would like to override that for a specific query. How can I make my query case-sensitive with respect to comparison operations?

Jacob

View 5 Replies View Related

Transact SQL :: Upper Case To Lower Case Conversion

May 4, 2015

I have column with value of all upper case, for example, FIELD SERVICE, is there anyway, I can convert into Field Service?

View 7 Replies View Related

Report Designer: Need To List Fields From Multiple Result Rows As Comma Seperated List (like A JOIN On Parameters)

Apr 9, 2008



I know I can do a JOIN(parameter, "some seperator") and it will build me a list/string of all the values in the multiselect parameter.

However, I want to do the same thing with all the occurances of a field in my result set (each row being an occurance).

For example say I have a form that is being printed which will pull in all the medications a patient is currently listed as having perscriptions for. I want to return all those values (say 8) and display them on a single line (or wrap onto additional lines as needed).

Something like:
List of current perscriptions: Allegra, Allegra-D, Clariton, Nasalcort, Sudafed, Zantac


How can I accomplish this?

I was playing with the list box, but that only lets me repeat on a new line, I couldn't find any way to get it to repeate side by side (repeat left to right instead of top to bottom). I played with the orientation options, but that really just lets me adjust how multiple columns are displayed as best I can tell.

Could a custom function of some sort be written to take all the values and spit them out one by one into a comma seperated string?

View 21 Replies View Related

Expression After Table Object Forced To Display On The Last Page Even There Are Still Spaces At The Bottom Of The First Page.

Oct 16, 2006

The following objects are placed on the Report body of the Report pane of SQL Server 2005 Reporting Services :

<textbox: expression1>
<textbox: expression2>

<table:table1 with at least 30 columns and 30 expressions>

<textbox: string1> - considered as the Title in the Footer section of the report

<texbox:string2> <textbox:expression3>
<textbox:string3> <textbox:expression4>
<textbox:string4> <textbox:expression5>
<textbox:expression6>

I can't find any explanation why is it string1 and string 2 of the footer section of my report displayed separately from the expression3 which is aligned on it and the rest of the object on the second page.

The expected design is that all Footer items should be displayed together of whether it is placed on the first page or on the last page.

As a workaround of this, I converted string 1 into an expression (Added = and enclosed the string with double quote).. As a result, all of the items in the Footer section are now placed together on the last page of the report.

I also remember one of the issue I encountered before where the Footer items where placed together on the first page and still have space at the bottom of the page, but then expression 6 is forced to display (alone) on the last page of my report.

I can't find any discussion related to this, I wish somebody could give me an idea why RS behaved like this.

Thanks in advance

View 1 Replies View Related

Fit An Intere Table In Same Page Without Page Breaks Excel Export In A Single Sheet.

Feb 14, 2008

Fit an intere table in same page without page break for save the excel export.

My table has a Group for order my dates.

I need to have the intere table in the same page, i don't care about blank space at the end of the page.

I can't use the page break beacuse i need an excel export in a unique sheet..
I have tested.. every page break..you'll have a different sheet in your excel export

I need something like this

page 1

Zone
1
2
3
4
5
6
7
7
8
9
..

page 2

Zone
1
2
3
4
5
6
7
7
8
9
..

but an unique sheet in the excel export

View 4 Replies View Related

Local - Including Page Header Forces Viewer To Expand To Page Size

Jul 17, 2007

Hello,
If I have a report that includes a page header, the report viewer will render the report at the full width, but if I hide the page header and show only the body it will use the absolute width of the report.

I have a 7" wide report, with .75" borders set on each side.

Interactive & Print size are set to 8.5x11
Changing these sizes has no effect on the behavior of the viewer, which appears to ignore them.


When I view this report in the local viewer the contents fill the window if there is no page header.
If I enable the page header then the report is drawn at 8.5" wide, leaving a _big_ white border on the right side.
Any comments or workarounds that anyone knows? I know the local viewer is not a standard configuration (at least it seems) but it is what we need to use.Thanks,//Andrew

View 1 Replies View Related

How To Access A .asp Page Or .aspx Page From A Store Procedure In Sql Server 2000

Sep 21, 2006

Hi, I wanted to know that can we access a webpagefrom a store procedure in sql server 2000 like we run a exe file from sql server. Bye.

View 1 Replies View Related







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