SQL Statement For ASP Page

May 29, 2002

I want limit the number of unique entries in one of my columns to 3 for a single user. For example, in this table, User 1 could enter as many records as they like as long as they do not try and create more than 3 unique entries for 'WatchListName'. If they were to try and insert another record here with a 4th unique WatchListName value, I would redirect them to another page. Can someone please help me out with the SQL syntax for this kind of statement? Thanks.

UserID WatchListName
1 Turnover
1 Turnover
1 Expenses
1 Funds
1 Expenses
1 Turnover

View 1 Replies


ADVERTISEMENT

Help With An SQL SELECT Statement In ASP Page

Mar 19, 2004

I have built this SQL statement which should
create the RS I need.

strSQL1 = "SELECT [INVENTRY MASTER].BOX_NO FROM [INVENTRY MASTER] WHERE
Left([INVENTRY MASTER].BOX_NO, PatIndex('%821%', [INVENTRY MASTER].BOX_NO) -
1) NOT LIKE '%[1-9]%' AND [INVENTRY MASTER].BOX_NO LIKE '%821%';"

This Line:

objRS1.Open strSQL1, objConn

Causes this error:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid length parameter
passed to the substring function.

I have searched google, and found reference to the error meaning it found a
space in the first position. I tried adding LTRIM into my statement to cure
it but it made no difference, I may be barking up the wrong tree so to speak
;) but I cant find any other information on it.

If anyone has any ideas why this statement does not work I'd be very
grateful, the project has to be completed today, and this is the last thing
to get working now!

Ta

Paul McGuire

View 6 Replies View Related

Bank Statement Problem - Another Question Page 2

Jul 23, 2007

Hi all,

Im new so apologies in advance if this is an easy one.

I have a single table which holds:
ID (PK)
EnteredDate
MonetaryValue
REF_ValueType

It's basically used to record income and expenditure and the records look something like:

ID EnteredDate MonetaryValue REF_ValueType
1 21/01/07 12.34 Received
2 22/01/07 -8.34 Paid
3 23/02/07 100.28 Received

What Im trying to do is to write sql that will return all the records in the form of a bank statement with received values in one column and paid values in another e.g.
Date Income Expenditure
21/01/07 12.34
22/01/07 -8.34
23/02/07 100.28

Ive tried all ways but I still can't get it to work. Is there a simple way.

All advice most definitely appreciated, it's sending me crazy. Many thanks in advance

Mike

View 20 Replies View Related

How To Page SQL Query Result Returned From FOR XML Statement?

Apr 25, 2006

Gurus.I do not know if it is possible, but here is what I want to do.I want to allow user to page the SQL result, so he could decides toreturn from row 10 to row 20, or row 100 to 200, without returns thewhole resultset. Every time he sends another request, I do not mind tohit the database again, (I do not want to cache the result in themiddle tier server, scalability issue), and I know that I could achievethis with CURSOR, but unfortunately the FOR XML is not allowed in aCURSOR statement .(I know that I could achieve what I want to do by writing custom codein the middle tier, but I just want to see if there is a way to do thison the database side.)Any comments & suggestion is greatly appreciated.Thanks in advance.(I am using SQL2005)John

View 2 Replies View Related

How Can I Post Back A Statement From A Store Procedure To The .aspx Page

Oct 17, 2005

Hi all,Anyone can show me how can I catch the 'Print' statement that I have defined in my store procedure using SQL server 2000 DB on the .aspx page? ( I am using ASP.NET 1.0)My store procedure as follow:CREATE PROC NewAcctType(@acctType VARCHAR(20))ASBEGIN --checks if the new account type is already exist IF EXISTS (SELECT * FROM AcctTypeCatalog WHERE acctType = @acctType) BEGIN  PRINT 'The account type is already exist'  RETURN END
 BEGIN TRANSACTION  INSERT INTO AcctTypeCatalog (acctType) VALUES (@acctType)
  --if there is an error on the insertion, rolls back the transaction; otherwise, commits the transaction  IF @@error <> 0 OR @@rowcount <> 1   BEGIN    ROLLBACK TRANSACTION    PRINT 'Insertion failure on AcctTypeCatalog table.'    RETURN   END  ELSE    BEGIN    COMMIT TRANSACTION   ENDENDThanks for all your replies

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

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

DBCC SHRINKFILE: Page 4:11283400 Could Not Be Moved Because It Is A Work Table Page.

Jul 20, 2007



Hi,



I issued this command on Tempdb but it doesnot shrink the file.



dbcc shrinkfile (tempdev_3,1)

go



Messages:

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

DBCC SHRINKFILE: Page 4:11283400 could not be moved because it is a work table page.

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



I have checked that there are no tables associated with any user in tempdb. Any help is appreciated.



Regards,

Razi

View 15 Replies View Related

How Can I Print A Field That Is In The Dataset On Each Page And Show The Table Hearder On Each Page?

Apr 16, 2007

How can I print a field that is in the dataset on each page? I added a textbox in the Page Header and use =Fields!ProjectName.value in the value property. I got an error "Fields cannot used in page header and footer."



How can I have the table header shows on each page? Currently if the data goes to the second page, there is no table header.



Thanks.

DanYeung

View 8 Replies View Related

Removing The White Space In Between The Image And Page Border Of The Page Header

May 26, 2008

Hi Team,


When i view the Report from SSRS Report preview Tab it's working fine, But when i deploy that and try to view in the IE
I am seeing the Body background color in between the image and page border of the page footer how to solve that?

View 1 Replies View Related

Single Page Report In SSRS Is Printing With The Second Page Blank....URGENT

May 16, 2008



Hi All,
In my SSRS report. I have a report which has only one page. In preview it is showing as only 1 page but when I am printing the report. I am getting two printouts with the second page as a blank.. Please help me in printing the page that contains report. Intially I used a Page header, at that it used to print the blank page with a header only. Now as I removed the header it is printing the page without header i.e Blank Page.. So please help me in prinitng a single page that has the report. It is urgent,..

Thanks
dotnetdev1

View 5 Replies View Related

Reporting Services :: Tables Are Showing Up In Same Page When There Is No Data Even After Giving Page Break Option

May 7, 2015

I have a report with multiple tables. I need to show each tables in different pages. When there is no data for tables/tables , it is coming with the next table which has data. I have given "Add a page break after" option in the tablix but still the tables are coming together when no data available. How can I show it in different page?

View 2 Replies View Related

SQL Server 2012 :: Force Page Footer At Bottom Of The Page

Mar 12, 2015

I have a report with tablix. when tablix returns no rows Footer is coming all the way up . How to display the footer at the bottom of the page all time.

View 0 Replies View Related

Reporting Services :: Page Break In Middle Of Two Page Report

Nov 11, 2015

How do I add a hard page break in the middle of a two page report? I use Microsoft reports for windows.

View 5 Replies View Related

Page Header Taking Up Blank Space On 1st Page Even If Not Printing

Apr 15, 2008

In SRSS 2005 (SP2) my page header seems to take up the same amount of space on the
1st page it would take if it were to print; I have PRINT ON FIRST PAGE set to
false - the header doesn't print - it just leaves the same amount of space.
How do you get the report to ignore that. I do have a report header built
into the body of my report. I have tested this by increasing the size of my
page header and it does move the report up or down on the 1st page by that
amount.

View 8 Replies View Related

Blank Page When Printing/Exporting Prior To Every Report Page

Jan 23, 2008

I'm hoping that someone can shed some light on this for me... I'm using SSRS SP2 and I have a basic report using a single list object which, at the moment, should print only two pages based on the results of the underlying query. When previewing the report, it shows the two pages. But when the report is printed or exported, there is a blank page before each report page.

What I've done so far:
1) Verified the properties of the list object and made sure that 'Insert a page break before this list' is not checked

2) Ensured that there are no hidden objects that could be causing this behavior
3) Ensured that the report size + margins are within the boudaries of an standard 8.5x11 paper size


Any suggestions on something that would solve this issue?

Sam

View 6 Replies View Related

SQL 2012 :: Why Does SHRINKFILE Page Latch On A Page In Different File

Sep 28, 2015

I am running a DBCC SHRINKFILE on "FILE1" of a database (it has fileid = 1)...intent is to remove 70GB of file space:

DBCC SHRINKFILE (N'FILE1' , 400000).

For the SPID that's doing the shrink, In activity monitor you can see:

Waittype: PAGEIOLATCH_EX on resource: 9:3:15411328
(the DB is dbid=9)

But why does it need a page from fileid=3? Are there page dependencies between files that prevent moving a page within a given file? Does it need that fileid3 page to come along?

Its just sitting there in the SUSPENDED state for the last hour....I am going to leave it another 5 hours or so before cancelling.

The dm_exec_requests has an estimated percent complete at 83% and holding....not sure if I can believe that.

View 6 Replies View Related

Display Or Hide Page Footer Depending On The Page

Nov 13, 2007

Hi all

I have a problem which I am really struggling with. I have a report that normally spreads over three pages. We have a list setup so that for each customer it picks up fees and expenses and displays it in sections. We have a page break after FEES so that expenses start on a new page. FEES and expenses are tables.

We need to have a page footer set for the bottom of the report but to appear on the first page only per customer. I.e. we do not want it showing on the EXPENSE pages. We have played with the IIF command but can not seem to print htis per customer only by using global variables.


=IIf(Globals!PageNumber=1,"(Please note 30 day invoice period)

The example above however only prints on the first page of the entire report. So if three customers appear then this will only appear for the first customer and I have a feeling I may not be able to link this to list.

If I can not use a page break and enter this into the list then I have a problem with the text field moving up and down depending on the size of the FEE section. For example if 5 fees are brought back then the text field will be lower then a customer that has only 2 fees.

I after a solution that can either allow my page fotter to appear every time a new customer appears on a page and hiddern for the sub sheets. Or the ability to allow my text field to start at a fixed position on my report. Has anyone had a similar issue.

thank you

Michael

View 3 Replies View Related

Make Multip Page Report To Be Shown In One Page

Jan 23, 2008

Hi:
I made a report that is 10 pages long. I like to show all the data in one page (after deployment). Any idea if this is possible?

View 8 Replies View Related

One Page Report - One Result Row In SQL = One Full Page Of Data

Feb 27, 2008

Hi - I am pretty new to Reporting Services. I need to create a report where a single result row from the Select Statement populates an entire page of data. The regular grid or Matrix reports don't fit this need. Is there a simple way to do this?

Thanks - Dave

View 4 Replies View Related

How To Force The Page Footer To Display At The *bottom* Of The Page

Apr 3, 2006

Is it possible to force the content of the page footer to always display at the bottom of a report? I have a report that shows customer orders. It has its interactive height set to 5 inches. There is one customer order per report page. Most of the reports don't require 5 vertical inches (but some do).

How can I make sure that the stuff in the page footer (date, page number, etc.) always gets rendered in the same position for each report? Currently, the page footer follows the last detail line so the footer information sometimes is only midway down the report page.

Thanks.

BCB

View 4 Replies View Related

How To Find A Row By (file#:page#:slot On Page)

Jan 27, 2004

Hi

I would like to know if there is some way to find a row in a table by the RID that sp_lock returns :

for example

"SELECT * FROM Authors (UPDLOCK) WHERE name = 'John'"

sp_lock returns the locked row id :
2:328:11 (file#page#slot on page)

How do i get this row???

Thanks

PB

View 3 Replies View Related

Blank Page &&amp; Page Footer Problem

Mar 31, 2007

hi i am very concerned about this problem in my report.



to solve this problem i increased the height of page footer,blank page vanishes but the page footer is not printing on every page,it is only printing on 1 st page .



i am having probelm because the records from the dataset are more than the page limit , page break is there but no footer is printing on the second page only blank space is there.



can u please help me out from this problem??



View 1 Replies View Related

Using Pagenumber Outside Of Page Header And Page Footer

Sep 14, 2007

can i use 'page number' and 'total pages' outside the page header and page footer?

View 1 Replies View Related

Page Header Being Truncated When Page Size Changes

Nov 26, 2007

I think I know the answer but I have a report that is supposed to print in Ledger. It has a header that has report information on the left and on the right has page count and date run. When the user resizes the page to letter, only the first part of the header shows (left piece with report information). Instead of resizing the header it seems it truncates it. Is there a way to resize it. If I move the right side over it looks centered on the Ledger size.

View 1 Replies View Related

How To Set How Many Records Showed In Each Page In View Page?

Dec 12, 2007

I want to show more records in each page when i view report
Question is subject above
any idea? thanks

View 4 Replies View Related

How To Display A Multiple-page Report In One Page

Dec 10, 2007

I have a report which is multiple pages in the report viewer. Now I want to make it shown in the webpage report viewer just in one page. Is there any ways to realize it?

Thanks

View 1 Replies View Related

Multiple Columns Starts On Second Page Not On First Page

Jan 21, 2008

Hi,

I have a report with 2 columns.I have a list which has 4 textboxes attached to a dataset's fields.
Report Interactive Size:8.5in, 11in
Margins:0.1in, 0.1in, 0.5in, 0.5in (L;R;T;B)
Body Size : 3.125in, 1in
List Size:2.875in, 0.75in
Each texbox is set to cangrow false
My problem is when I print that report I get only one column on the first page.
I start to get the correct report on second page which has 2 columns.
If I export to pdf, everything is is fine no problems at all.
I am using VS 2008 Pro and local reports.
What am I missing?
Thanks for help.

View 1 Replies View Related

Databound Page Footer For SSRS. How To Get It On Every Page?

Feb 14, 2008

I have seen some forums on SSRS page footer which is data bound.
The procedure is as follow:
a hidden text box is put into the body of the page...which can be data bound..
than a textbox is placed in the footer, which is linked to the hidden text box in
the body. This is a good solution to this problem.. but the is 1 major problem I am
facing. I render the report to PDF. But the result is that the databound footer
shows up only on the last page. I need it to be seen on all the pages..
Can someone tell me how to solve this problem?

View 13 Replies View Related







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