Please Give Me Your Suggestions On Report Query - Very Urgent

Oct 25, 2006

I need to disaplay number of Active Agencies on monthwise in one of my report. I have tbl_Agency table with ActiveDate and ActiveFlag. ActiveDate column contains always first Activation Date. If any chances in the agencies(update/delete) the same record will move to tbl_AgencyHistory table.

"If an agency is inactivated in September 10th, inactivated all of October, and then reactivated November 10th - the agency would be counted in September, not in October and counted in November"

ActiveDate column has always first activation date, I could not meet this requirement. This is very urgent issue, Could you please help me on this.

Thanks,

Malar











View 6 Replies


ADVERTISEMENT

Any Solution For This??Please Give Some Suggestions

Dec 11, 2001

I have started working with MS SQL Server 2000 recently. I have a scenario in which I require to know within the given period of time ( say 5 mins) , which all tables from a particular database got modified. I do not want to write a trigger for each and every table for all the 13 databases , my application deals with. I have even tried the following query:
declare @curdate datetime
select @curdate=getdate()
select name, refdate from sysobjects
where xtype = 'U' and refdate =@curdate

But nope it does not help me, since refdate is something else. Can anybody tell me how can you figure out from sysobjects when was a particular object last accessed , even this would serve my purpose.

I have trying to get this done via profiler. My applications api's connect to the database under some credentials which i do not know since I do not have access to source code ( i am doing black box testing). So I can't even put a trace on one particular user account. What I am doing currently is trapping all store procedure events..., but then its too much of work...

Hence I wanted to know , is there any way out for the situation where given a database name and a time span we can find out the tables modified/accessed within that time span from that database ???

View 3 Replies View Related

Please Give Kind Attension To My Queries Very Urgent

May 9, 2007

Please give kind attension to my queries



When I am giving like http://localhost/ReportServer the following message is coming in explorer. What I have to do please help


Reporting Services Error



The version of the report server database is either in a format that is not valid, or it cannot be read. The found version is 'Unknown'. The expected version is 'C.0.8.40'. To continue, update the version of the report server database and verify access rights. (rsInvalidReportServerDatabase) Get Online Help



SQL Server Reporting Services



View 4 Replies View Related

SQL Query Suggestions/help

Jul 20, 2005

I'm trying to count the number of records in 'game_dates' where thecolumns home_team_id or away_team_id have the same value. E.g., iwant to know the number of records for each team_id where team_id ishome_team_id or away_team_id.I'm doing this in two separate select statements now. Example:SELECT count(home_team_id),home_team_id FROM gamesWHERE league_id = 218 and ((home_score IS NOT NULL OR away_score ISNOT NULL) OR (home_score <> 0 OR away_score <> 0))GROUP BY home_team_idandSELECT count(away_team_id),away_team_id FROM gamesWHERE league_id = 218 and ((home_score IS NOT NULL OR away_score ISNOT NULL) OR (home_score <> 0 OR away_score <> 0))GROUP BY away_team_idand then combining the results. Is there anyway to combine these toqueries into one query? ...and have a single result set returned withtwo columns (count,team_id)?Thanks,Glenn

View 3 Replies View Related

Query To Give All Table Sizes On A Database (was Query Help)

Mar 9, 2006

Hi,
Does anyone has query to give all table sizes on a database?
Appreciate your help.
Thanks

View 2 Replies View Related

Transact SQL :: Create A Report Which Would Give Latest Transaction On Database

Jul 17, 2015

I'm trying to create a report which would give the latest transaction on a database, which all sit on different servers. I wanted to know if there is an a simple way tracking the latest transactions instead of getting the information from the database tables.

View 3 Replies View Related

Why Did MS Give Access To Reports Thru Both Reporting Manager And Report Server?

Dec 20, 2007

what is MS's strategy for having two off the shelf ways of getting at reports? In a typical company, is the average non administrator type user getting at his reports via one, the other, both?

View 1 Replies View Related

Monsterous SQL Query... Suggestions?

Jan 17, 2008

Hi All,

I work for a telco. We've got a table in a database which shows phone calls made by customers and when they made them.

I need to generate a list of customers who have made phonecalls last month and have NOT had a five days in a row without making any calls.

Can any of you help? I'm not sure how to tackle this one without getting a very bloated and inelligent solution. Basically, the only solution I can think of is generating 31 tables, one for each day and then just checking calls made on each day.

Has anyone got a better idea?

I'm using SQL Server 2000.

Thanks

Dave

View 14 Replies View Related

Suggestions For Rewriting This Query

Oct 24, 2007

Does anybody have any suggestions to rewrite the 2nd WHEN part of the query??? Thank you.

------------------------------------------------------------
update t_pgba_hdr
set HCFA_PLACE_TRMT_CD2 =
case when (select max(b.HCFA_PLACE_TRMT_CD)
from t_pgba_hdr as b
where t_pgba_hdr.clm_id2 = b.clm_id2) like '[A-Z]%'
then '99'
when (select ltrim(rtrim(max(b.HCFA_PLACE_TRMT_CD)))
from t_pgba_hdr as b
where t_pgba_hdr.clm_id2 = b.clm_id2) in '[0-9]'
then '0' + (select ltrim(rtrim(max(b.HCFA_PLACE_TRMT_CD)))
from t_pgba_hdr as b
where t_pgba_hdr.clm_id2 = b.clm_id2)
end

------------------------------------------------------------


-soumya

View 4 Replies View Related

Subtotals In Report Give Infinity Value In Case Of Empty Cells In Column.

Mar 13, 2008

The title, I think, accurately illustrates the situation in my report.
Naturally, this result is unwanted.

How do I get the avg-function to ignore empty cells in the column?

Thanks in advance,

Pluggie

View 5 Replies View Related

Can We Generate Reports Without Using Report Viewer And Give A Popup For Saving And Opening It?

Apr 24, 2008

Hi


I am generating a Report by using SSRS. I am making using use of SSRS Report Viewer control for displaying the report. Which has an option to export the generated report in PDF format. Instead of displaying the report in by using report viewer I want to generate it directly in PDF format whenever that report is selected from the list of reports. So is there is any way to generate the report directly in PDF format which prompt a pop up for opening or saving the PDF?


Thanks,
Shailesh

View 3 Replies View Related

Can Anyone Give Me A Query For This ?

Jul 20, 2005

These are my table structures . Could you please suggest me analternative:tblArticles: ArticleID,Title,Summary,ContextSubTypeID,PostDatetblArticlePages: ArticlePageID,ArticleID,PageNum,ContenttblAuthors:AuthorID, NametblArticleAuthors:ArticleID,AuthorIDtblContextSubtype:ContextSubTypeID,NameI need to get Author,PostDate,Title,tblContextSubType.Name,PageN um,Content,- these have to grouped accordingly by the respective fields. Contentneed not be grouped by.

View 2 Replies View Related

Page 2 - Monsterous SQL Query... Suggestions?

Jan 18, 2008

Here you go:

The telephone numbers are just strings of the same integer,

1's: Calls made every day
2's: Calls made every day
3's: Two, non consecutive days without calls
4's: No calls made from 2nd till 6th
5's: Only one day with calls
6's: No calls made from 2nd to 6th, but many made on the 1st
7's: No calls made from 2nd till 13th

If you'd like a bigger sample set then I will create one.


Code:


CREATE TABLE tblCallSummary(
[CallID] [int] IDENTITY(1,1) NOT NULL,
[TelephoneNumber] [varchar](11) NOT NULL,
[StartTime] [smalldatetime] NOT NULL,
[Duration] [int] NOT NULL,
CONSTRAINT [PK_tblCallSummary] PRIMARY KEY CLUSTERED
(
[CallID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-01'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-02'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-03'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-04'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-05'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-06'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-07'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-08'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-09'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-10'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-11'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-12'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-13'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-14'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-15'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-16'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-17'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-18'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-19'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-20'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-21'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-22'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-23'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-24'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-25'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-26'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-27'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-28'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-29'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-30'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('11111111111',CONVERT(smalldatetime,'2007-12-31'),1)

INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-01'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-02'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-03'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-04'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-05'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-06'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-07'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-08'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-09'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-10'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-11'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-12'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-13'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-14'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-15'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-16'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-17'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-18'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-19'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-20'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-21'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-22'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-23'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-24'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-25'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-26'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-27'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-28'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-29'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-30'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('22222222222',CONVERT(smalldatetime,'2007-12-31'),1)

INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-02'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-03'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-05'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-07'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-09'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-11'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-12'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-13'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-14'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-15'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-16'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-17'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-18'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-19'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-20'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-21'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-22'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-23'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-24'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-25'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-26'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-27'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-28'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-29'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-30'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('33333333333',CONVERT(smalldatetime,'2007-12-31'),1)

INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-01'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-07'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-08'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-09'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-10'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-11'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-12'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-13'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-14'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-15'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-16'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-17'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-18'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-19'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-20'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-21'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-22'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-23'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-24'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-25'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-26'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-27'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-28'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-29'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-30'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('44444444444',CONVERT(smalldatetime,'2007-12-31'),1)

INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('55555555555',CONVERT(smalldatetime,'2007-12-10'),1)

INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-01'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-07'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-08'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-09'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-10'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-11'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-12'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-13'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-14'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-15'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-16'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-17'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-18'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-19'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-20'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-21'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-22'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-23'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-24'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-25'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-26'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-27'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-28'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-29'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-30'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('66666666666',CONVERT(smalldatetime,'2007-12-31'),1)

INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('77777777777',CONVERT(smalldatetime,'2007-12-01'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('77777777777',CONVERT(smalldatetime,'2007-12-14'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('77777777777',CONVERT(smalldatetime,'2007-12-15'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('77777777777',CONVERT(smalldatetime,'2007-12-16'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('77777777777',CONVERT(smalldatetime,'2007-12-17'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('77777777777',CONVERT(smalldatetime,'2007-12-18'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('77777777777',CONVERT(smalldatetime,'2007-12-19'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('77777777777',CONVERT(smalldatetime,'2007-12-20'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('77777777777',CONVERT(smalldatetime,'2007-12-21'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('77777777777',CONVERT(smalldatetime,'2007-12-22'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('77777777777',CONVERT(smalldatetime,'2007-12-23'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('77777777777',CONVERT(smalldatetime,'2007-12-24'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('77777777777',CONVERT(smalldatetime,'2007-12-25'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('77777777777',CONVERT(smalldatetime,'2007-12-26'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('77777777777',CONVERT(smalldatetime,'2007-12-27'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('77777777777',CONVERT(smalldatetime,'2007-12-28'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('77777777777',CONVERT(smalldatetime,'2007-12-29'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('77777777777',CONVERT(smalldatetime,'2007-12-30'),1)
INSERT INTO tblCallSummary(TelephoneNumber,StartTime,Duration) VALUES('77777777777',CONVERT(smalldatetime,'2007-12-31'),1)



Our requirements have just changed and we only need customers which were active in the last five days, a very easy query. So please don't spend too much of your time on this now, however, I am still keen to find an elegant way of solving this problem, if one exists so any input from you would be appreciated.

Thanks for you help

Dave

View 5 Replies View Related

Multiple Parameter SQL Query??? Any Suggestions

Sep 19, 2007

My end result will be a query with about six parameters total. But for right now I am trying to one by one for testing purposes. This is my first SQl project. All of my information goes into an Access DB. I am basically creating a search page with parameters for the employees to use to search for data. I need the query to work if all parameters, or combinations of parameters, or just one parameter is chosen. I started with one and got to three but now I'm stuck. My first two parameters are dates, so the data can be chosen by date range, and the second is location id. If I choose date range by itself it works, If I choose location id by itself it works, but If I choose both it doesn't work. Instead of filtering it gives me everything and I have a statement for it. Can someone please help me and tell me what am I not doing right. Here is my code;

SELECT *
FROM ASFdata
WHERE
(ASFdata.reportlocid = <cfqueryparam value="#Form.reportlocid#"> AND <cfqueryparam value="#Form.datefield#"> <> datefield AND <cfqueryparam value="#Form.datefield2#"> <> datefield) OR
(ASFdata.datefield BETWEEN <cfqueryparam value="#Form.datefield#"> AND <cfqueryparam value="#Form.datefield2#"> AND NOT <cfqueryparam value="#Form.reportlocid#"> = reportlocid ) OR
(ASFdata.datefield BETWEEN <cfqueryparam value="#Form.datefield#"> AND <cfqueryparam value="#Form.datefield2#"> AND ASFdata.reportlocid = <cfqueryparam value="#Form.reportlocid#">)

View 12 Replies View Related

Give Sql Query For This Illustrations

Mar 28, 2008

Hai friends
 i have table student with 2 fields s_id,s_name
s_id      s_name1            raja2           ramu3           vinoth4            muthu5            arun
i have another table test with s_id who wrote test...
s_id    25
now i have to display like below....give me sql query
s_id   s_name2        ramu5        arun
Thanks in Advance...pl Help me......  

View 2 Replies View Related

Give Me Sql Query For One Illustrations

Mar 28, 2008

Hai friends i have table
s_team
id           name       game
 1           raja         cricket
2            ravi          football
3            muthu     cricket
4           pravin      cricket
5          hurry       football
 I have to diplay the above table in the following ...pl give me sql query
game          totalplayers
cricket            3
football           2
 

View 2 Replies View Related

Any Suggestions On How To Optimize A Query Written In Dynamic SQL?

Oct 15, 2007

I added the subquery and now this thing consistently takes more than five minutes to return 7100+ rows. Any suggestions? Thanks again, you guys are the best.

ddave
----------------------------
SET @StrQry1 = '(SELECT 1 AS Counter, Q1.SubsidyLevel, VEL.*
FROM dbo.ViewEligibilityPHC VEL
LEFT OUTER JOIN (SELECT *
FROM dbo.MEMB_LISHISTS l
WHERE l.LISThruDate is null
AND l.Deleted = ''0'') AS Q1 ON VEL.MEMBID = Q1.MemberID
WHERE VEL.OPTHRUDT is null
AND VEL.OPT LIKE ''' + @HPlan + ''' AND (VEL.PCP IS NULL OR VEL.PCP LIKE ''' + @Prvdr + ''')
AND VEL.HCC LIKE ''' + @HCC + ''' AND (VEL.CaseMgrID IS NULL OR VEL.CaseMgrID LIKE ''' + @CaseMngr + ''')
AND VEL.OPFROMDT <= CAST(''' + @SDate + ''' AS datetime)
AND ISNULL(VEL.OPTHRUDT, CAST(''' + @TDate + ''' AS datetime)) >= CAST(''' + @EDate + ''' AS datetime)) '

View 12 Replies View Related

DateRange Query Give Wrong Results

Sep 1, 2004

I am running some query with the following where clause

where DateCreated BETWEEN '06/01/2004' AND '06/30/2004'

It gives the records where DateCreated is of 2004-07-01 21:48:02.377

the default language on the server is British English.

Could anybody please tell me the reason why records from july are also coming

View 1 Replies View Related

OPENROWSET Query Will Give Syntax Error - Please Help Me

Feb 28, 2008

I am not able to use WHERE Clause in my query. What am I doing wrong?


Here my query that will generate error:
SELECT * INTO LN_S
FROM OPENROWSET('MSDASQL',
'DSN=SHADOW',
'SELECT * FROM LN_ACCT WHERE trn_dt > '2007-03-08' '

I am getting this error:
Server: Msg 170, Level 15, State 1, Line 4
Line 4: Incorrect syntax near '2007'.


Here is my query which doesn't generate error:
SELECT * INTO LN_S
FROM OPENROWSET('MSDASQL',
'DSN=SHADOW',
'SELECT * FROM LN_ACCT'

Using SQL Server 2000
DSN to a CACHE database on local network

Thanks in advance,

Sam

View 3 Replies View Related

Using SUM To Give Interim Totals Every 'x' Rows From A Query

Jun 29, 2007

First off, here is the application.

An airport baggage handling system distributes bags using multiple conveyors.
Bag counts are logged every 15 minutes. There is a count for each conveyor.
Example Log Table layout is as follows (The TIME column is DateTime, the Convx columns are TinyInt)

Time Conv1 Conv2 Conv3 Conv4 Conv5 Conv6

i 3 2 3 4 2 1

i+15min 2 3 4 2 2 2

i+30min etc.....................

i+45min

i+60min

etc...



The management team wants a throughput report which will take the following parameters in order to filter the results:

Begin Date
End Date
Time Interval (selectable as 15mins, 30 mins, 45mins, 60 mins and Daily)

My question is this. Given that my raw data has 1 row for every 15 minutes, if they select 60 minutes as their interval I need to run the query with the start and end dates but Sum every 4 rows and display it as 1 row, likewise if they select 30 minute interval, I need to sum every 2 rows. How do I run a query and SUM the Conv count data for every x number of rows and use the 1st TIME value in the returned x row summary?



Thanks for your help and let me know if I need to clarify anything

View 3 Replies View Related

Create A Query That Will Give Result Set Containing Primary Order On Type

May 14, 2012

I have a table with plant types and plant names. Certain plants are grouped on a custom field, currently called Field. I am trying to create a query that will give me a result set containing the primary order on Type, but need items with the same 'Field' value grouped by each other.For example, the following shows a standard query result with "order by Type", ie select * from plants order by Type

Code:
ID Type Name Field
1 Type1Name1(group1)
2 Type2Name2(group2) -group2
3 Type3Name3(group3)
4 Type4Name4(group4)
5 Type5Name5(group2) -group2
6 Type6Name6(group6)

But I want it to look like this, with fields of the same value located next to each other in the result set (but still initially ordered by Type)

Code:
1 Type1Name1(group1)
2 Type2Name2(group2) -group2
5 Type5Name5(group2) -group2
3 Type3Name3(group3)
4 Type4Name4(group4)
6 Type6Name6(group6)

View 7 Replies View Related

Transact SQL :: Create A Pivot Query That Will Give Result That Is Horizontal

Jul 8, 2015

I have some data which is vertical...I want to create a pivot query in SQL that will give me a result that is horizontal like this. I cannot find a way of doing it without lots of IF or CASE statements?

View 10 Replies View Related

Transact SQL :: Query To Give Results Of All Configured Alerts Occurring History

May 14, 2015

We created sql alerts on all our sql servers environments. Now, i want to see each sql server which sql alerts so far got fired and which one never occurs. is there any way, we can get this information from any system database?

View 9 Replies View Related

Please Help Me To Optimize This Sql Query, It Takes 28 Seconds To Return Result. Please Give Me A Tips Where I Went Wrong?

Aug 21, 2006

SELECT * FROM
( SELECT TOP 15 * FROM
(SELECT TOP 15 CMDS.STOCKCODE AS CODE,CMDS.STOCKNAME AS NAME,CMDS.Sector AS SEC, CMD7.REFERENCE AS REF,T1.HIGHP AS HIGH,
T1.LOW,T1.B1_CUM AS 'B/QTY', T1.B1_PRICE AS BUY,T1.S1_PRICE AS SELL,
T1.S1_CUM AS 'S/QTY', T1.D_PRICE AS LAST,T1.L_CUM AS LVOL,T1.Chg AS CHG,T1.Chgp AS CHGP, T1.D_CUM AS VOLUME,substring(T1.ST,7,6) AS TIME,
CMDS.SERIAL as SERIAL FROM CMD7,CMDS,CMD4 AS T1 WHERE T1.ST IN
(SELECT max(T2.ST) FROM CMD4 AS T2 ,CMDS WHERE
T1.SERIAL=T2.SERIAL
AND CMDS.SERIAL=T2.SERIAL
AND T2.sd='20060821'
AND CMDS.sd='20060821'
AND T2.L_CUM < '1900'
AND CMDS.sector >='1'
AND CMDS.sector <='47')
AND CMDS.SERIAL=T1.SERIAL AND
CMDS.SERIAL=CMD7.SERIAL AND
CMDS.sd='20060821' AND
CMD7.sd='20060821' AND
T1.sd='20060821' AND
T1.L_CUM < '1900' AND
CMDS.sector >='1' AND
CMDS.sector <='47' ORDER BY T1.D_CUM desc)
AS TBL1 ORDER BY VOLUME asc) AS TBL1 ORDER BY VOLUME desc;

View 6 Replies View Related

Reporting Services :: Give Meaning Full Name To Allow Null Value Check Box In Report Parameter Instead Of NULL?

Oct 20, 2015

In my report i have CNAME parameter , which allows null value. I checked Allow null value check box in report parameter properties.

when i preview the report , it displays checked NULL check box beside CNAME parameter . I want to give some meaningful name(i.e.ALLCustomers) to this checkbox instead of NULL. 

Is it possible through SSRS designer?

View 5 Replies View Related

Urgent..how To Add Sub Report..

Oct 2, 2007

Hi All..

my requirement is.. Main report will have some data displayed with 3 columns.. and need to display a sub report side to main report table.. which shows some data based on selection by any row value displayed in main report data..
for ex..
Main report displays country details data..

Country Name, Capital
*************************
USA, Washington
Canada, Ottawa
Mexico, Mexico City

if user clicks on USA sub report need to display dynamically following data
Sate , Capital
****************
Delawere, Dover
New Jersey, Trenton
Georgia, Atlanta

I could able to find info till adding a sub report. but no proper info in MSDN regarding passing values for parameters in navigation of column in main report which has navigation link to subreport

Seniors pls throw some light on this..

View 1 Replies View Related

Query Works In 'test Query' But Refuses To Show Up In The Datagrid On A Web Page - Urgent!

Mar 28, 2007

Hey, i've written a query to search a database dependant on variables chosen by user etc etc. Opened up a new sqldatasource, entered the query shown below and went on to the test query page. Entered some test variables, everything works as it should do. Try to get it to show in a datagrid on a webpage - nothing. No data shows.
 SELECT dbo.DERIVATIVES.DERIVATIVE_ID, count(*) AS Matches
FROM dbo.MAKES INNER JOIN
dbo.MODELS ON dbo.MAKES.MAKE_ID = dbo.MODELS.MAKE_ID INNER JOIN
dbo.DERIVATIVES ON dbo.MODELS.MODEL_ID = dbo.DERIVATIVES.MODEL_ID INNER JOIN
dbo.[VALUES] ON dbo.DERIVATIVES.DERIVATIVE_ID = dbo.[VALUES].DERIVATIVE_ID INNER JOIN
dbo.ATTRIBUTES ON dbo.[VALUES].ATTRIBUTE_ID = dbo.ATTRIBUTES.ATTRIBUTE_ID
WHERE ((ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID1 and (@VAL1 is null or VALUE = @VAL1)) or
(ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID2 and (@VAL2 is null or VALUE = @VAL2)) or
(ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID3 and (@VAL3 is null or VALUE = @VAL3)) or
(ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID4 and (@VAL4 is null or VALUE = @VAL4)) )
GROUP BY dbo.DERIVATIVES.DERIVATIVE_ID
HAVING count(*) >= CASE WHEN @VAL1 IS NOT NULL THEN 1 ELSE 0 END +
CASE WHEN @VAL2 IS NOT NULL THEN 1 ELSE 0 END +
CASE WHEN @VAL3 IS NOT NULL THEN 1 ELSE 0 END +
CASE WHEN @VAL4 IS NOT NULL THEN 1 ELSE 0 END -2
ORDER BY count(*) DESC

 Here is the page source
 
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DevConnectionString1 %>"
SelectCommand="&#9;SELECT dbo.DERIVATIVES.DERIVATIVE_ID, count(*) AS Matches&#13;&#10;&#9;FROM dbo.MAKES INNER JOIN&#13;&#10;&#9;&#9;&#9;&#9; dbo.MODELS ON dbo.MAKES.MAKE_ID = dbo.MODELS.MAKE_ID INNER JOIN&#13;&#10;&#9;&#9;&#9;&#9; dbo.DERIVATIVES ON dbo.MODELS.MODEL_ID = dbo.DERIVATIVES.MODEL_ID INNER JOIN&#13;&#10;&#9;&#9;&#9;&#9; dbo.[VALUES] ON dbo.DERIVATIVES.DERIVATIVE_ID = dbo.[VALUES].DERIVATIVE_ID INNER JOIN&#13;&#10;&#9;&#9;&#9;&#9; dbo.ATTRIBUTES ON dbo.[VALUES].ATTRIBUTE_ID = dbo.ATTRIBUTES.ATTRIBUTE_ID&#13;&#10;&#9;WHERE ((ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID1 and (@VAL1 is null or VALUE = @VAL1)) or&#13;&#10;&#9;&#9; (ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID2 and (@VAL2 is null or VALUE = @VAL2)) or&#13;&#10;&#9;&#9; (ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID3 and (@VAL3 is null or VALUE = @VAL3)) or&#13;&#10;&#9;&#9; (ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID4 and (@VAL4 is null or VALUE = @VAL4)) )&#13;&#10;&#9;GROUP BY dbo.DERIVATIVES.DERIVATIVE_ID&#13;&#10;&#9;HAVING count(*) >= CASE WHEN @VAL1 IS NOT NULL THEN 1 ELSE 0 END +&#13;&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; CASE WHEN @VAL2 IS NOT NULL THEN 1 ELSE 0 END +&#13;&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; CASE WHEN @VAL3 IS NOT NULL THEN 1 ELSE 0 END +&#13;&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; CASE WHEN @VAL4 IS NOT NULL THEN 1 ELSE 0 END -2&#13;&#10;&#9;ORDER BY count(*) DESC&#13;&#10;">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="ATT_ID1" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="TextBox1" Name="VAL1" PropertyName="Text" />
<asp:Parameter Name="ATT_ID2" />
<asp:Parameter Name="VAL2" />
<asp:Parameter Name="ATT_ID3" />
<asp:Parameter Name="VAL3" />
<asp:Parameter Name="ATT_ID4" />
<asp:Parameter Name="VAL4" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:DevConnectionString1 %>"
SelectCommand="SELECT * FROM [ATTRIBUTES]"></asp:SqlDataSource>
<br />
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource2"
DataTextField="ATTRIBUTE_NAME" DataValueField="ATTRIBUTE_ID">
</asp:DropDownList>
<asp:TextBox ID="TextBox1" runat="server" AutoPostBack="True"></asp:TextBox><br />
<br />
<br />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="DERIVATIVE_ID"
DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="DERIVATIVE_ID" HeaderText="DERIVATIVE_ID" InsertVisible="False"
ReadOnly="True" SortExpression="DERIVATIVE_ID" />
<asp:BoundField DataField="Matches" HeaderText="Matches" ReadOnly="True" SortExpression="Matches" />
</Columns>
</asp:GridView>
</asp:Content>
 AFAIK I have configured the source to pick up the dropdownlist value and the textbox value (the text box is autopostback).
 Am i not submitting the data correctly? (It worked with a simple query...just not with this one). I have tried a stored procedure which works when testing just not when its live on a webpage.
 Please help!
 
(Visual Web Devleoper 2005 Express and SQL Server Management Studio Express)
 

View 4 Replies View Related

Sql Server Report ---Urgent

Dec 20, 2007


View 6 Replies View Related

Urgent SQL SERVER REPORT

Aug 14, 2007

Hi All,

Iam Using sql server report ..how to declare"Report document" class in windows application ..
its any syntax is their..I mentioned below.for example crystal report "Report document" class..
that same class how to declare in sql server report "Report document" in windows application



Syntax:
------------


ReportDocument rpt1 = new ReportDocument();

View 1 Replies View Related

Please Help Me Very Urgent - Report Server

May 8, 2007

When I am giving http://localhost/ReportServer/ in internet explorer the following error is coming please help us. We already installed the report server




Server Error in '/ReportServer' Application.


The current identity (NT AUTHORITYNETWORK SERVICE) does not have write access to 'C:WINDOWSMicrosoft.NETFramework64v2.0.50727Temporary ASP.NET Files'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The current identity (NT AUTHORITYNETWORK SERVICE) does not have write access to 'C:WINDOWSMicrosoft.NETFramework64v2.0.50727Temporary ASP.NET Files'.

Source Error:





An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:





[HttpException (0x80004005): The current identity (NT AUTHORITYNETWORK SERVICE) does not have write access to 'C:WINDOWSMicrosoft.NETFramework64v2.0.50727Temporary ASP.NET Files'.]
System.Web.HttpRuntime.SetUpCodegenDirectory(CompilationSection compilationSection) +1036
System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags) +409

[HttpException (0x80004005): The current identity (NT AUTHORITYNETWORK SERVICE) does not have write access to 'C:WINDOWSMicrosoft.NETFramework64v2.0.50727Temporary ASP.NET Files'.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +709
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +317
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +595

View 9 Replies View Related

Sql Server Report -Urgent

Nov 1, 2007



Hi All,

I have to set Amount field properties to "Currency"
i got the answer like this:

$123
$234324.498
$-34343.55
$-33.00

how to change negative sign like this.., any properties is there

-$34343.55
-$33.00



View 5 Replies View Related

Urgent Help Me:(SQL SERVER REPORT)

Jul 21, 2007

Hi,



I created sql server Main & sub reports ...But i didnt get supreport in window application

Its Shows only Main report.



The Error Shown: Could Not Be Shown Subreport



How to call subreport in windows application...any coding is their.. its working backend (Main & Subreport reports)but its not working windows application. its shows only main report . I Mentioned my coding part below:



public partial class Form1 : Form

{

private string str = @"Uid=sa;pwd=systems;Data Source=Spring;Initial Catalog=VPMS";

private SqlConnection con;

private DataSet ds = new DataSet();

private SqlDataAdapter da;

private DataTable orderDetailsData = null;



private DataTable LoadOrdersData()

{

this.con = new SqlConnection(this.str);

this.ds = new DataSet();

this.da = new SqlDataAdapter("exec STP_RP_AR_ENCOUNTER", this.con);

this.da.Fill(ds, "OrderData");

return ds.Tables[0];



}



private DataTable LoadOrderDetailsData()

{

this.con = new SqlConnection(this.str);

this.ds = new DataSet();

this.da = new SqlDataAdapter("select * from VW_RP_SHR_Superbill where 1=1", this.con);

this.da.Fill(ds, "OrderDetailsData");

return ds.Tables[0];



}



private void SubreportProcessingEventHandler(Object sender, SubreportProcessingEventArgs e)

{

if (orderDetailsData == null)

orderDetailsData = LoadOrderDetailsData();

e.DataSources.Add(new ReportDataSource("Ds1", orderDetailsData));

}



public Form1()

{

try

{

this.Text = "Report Control Demo";

this.ClientSize = new System.Drawing.Size(700, 600);

ReportViewer reportViewer = new ReportViewer();



reportViewer.ProcessingMode = ProcessingMode.Local;



reportViewer.LocalReport.ReportPath = "RP_SHR_SuperBillPrint.rdl";



reportViewer.LocalReport.SubreportProcessing +=

new SubreportProcessingEventHandler(SubreportProcessingEventHandler);



reportViewer.LocalReport.DataSources.Add(

new ReportDataSource("Ds1", LoadOrdersData()));



reportViewer.Dock = DockStyle.Fill;

this.Controls.Add(reportViewer);



reportViewer.RefreshReport();


}

catch (Exception ex)

{

MessageBox.Show(ex.ToString());

}



}

private void Form1_Load(object sender, EventArgs e)

{

this.reportViewer1.RefreshReport();

this.con = new SqlConnection(this.str);

this.ds = new DataSet();

}


}

}



Please Help me Very Urgent:





Does anyone have any suggestions? Thanks.


View 6 Replies View Related

Urgent Sql Server Report

Aug 21, 2007



Hi All,


Iam working sql server report ...i want column of row increment automatically..how to set row increment in sql server report..for example i mentioned below


for example:

Name Id Description
1 john 1000 HOU
2 hawkins 2000 weferwe
3 rrrrrrrr 4444 444444


i mentioned that row increment 1,2,3 how to set automatically this field ..
if i written query or any properties is their...

its query means pls tele that query

View 6 Replies View Related







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