Showing posts with label display. Show all posts
Showing posts with label display. Show all posts

Monday, March 19, 2012

"User does not have permission to perform this action." problem

hey people

having a nightmare getting asp.net 2.0 to work with sql server 2005 express, bit of a newbie with it. trying to display a table from my sql database and every time i run the aspx table im getting this error.

 User does not have permission to performthis action.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack tracefor more information about the error and where it originatedin the code.Exception Details: System.Data.SqlClient.SqlException: User does not have permission to performthis action.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 identifiedusing the exception stack trace below.Stack Trace:[SqlException (0x80131904): User does not have permission to performthis action.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734995 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +130 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83 System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70 System.Web.UI.WebControls.GridView.DataBind() +4 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69 System.Web.UI.Control.EnsureChildControls() +87 System.Web.UI.Control.PreRenderRecursiveInternal() +41 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
 keep getting the user permission error, even though it says on the management console that i have access to the database
 
any ideas?
 
rob 
 

ok the error doesnt tell you that you cant login

the problem is you already login but you cant do action.

can you look your connection string and find out what account are you using.

then check that account's right in your SQL 2005 database,

maybe the right in that account is very small

|||

check if you user have not only rights to connect to database but also right to select from tables you use or execute rights to stored procedures so check database security and your user effective permissions on database objects

Thanks

|||

(having a nightmare getting asp.net 2.0 to work with sql server 2005 express, bit of a newbie with it. trying to display a table from my sql database and every time i run the aspx table im getting this error.)

If you don't have Management Studio you can download it in the first link below and the second link covers how to add object permissions for the Asp.net account post again if you still have question. Hope this helps.

http://msdn.microsoft.com/vstudio/express/sql/download/

http://forums.asp.net/thread/1492092.aspx

Saturday, February 25, 2012

"Max row" in each group

I'm having trouble developing a query that will group on a given set of
columns and, for each group, will also display the other columns in the
"max row" for that group. Let me illustrate what I mean:
CREATE TABLE [dbo].[GroupTest] (
[testID] [int] IDENTITY (1, 1) NOT NULL ,
[office] [char] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[startDate] [datetime] NOT NULL ,
[status] [int] NOT NULL ,
[endDate] [datetime] NULL ,
[reportDate] [datetime] NOT NULL ,
[amount] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[GroupTest] ADD
CONSTRAINT [PK_GroupTest] PRIMARY KEY CLUSTERED
(
[testID]
) ON [PRIMARY]
GO
Each row in this table represents a status update in an issue tracking
system. (The actual table has more columns. This is a subset for
illustrative purposes.) None of the columns is unique other than testID.
I am being asked to produce a query for each combination of {office,
startDate} will include the row matching that combination that has the
greatest value in the status column. So if office='ABC' and
startDate='2005-11-30' and there are two rows matching these values, one
with status=3 and one with status=4, the query should include the row
having status=4.
If the combination {office, startDate, status} were unique in this
table, the following query would do the job:
SELECT
G0.office, G0.startDate, G0.status,
G0.endDate, G0.reportDate, G0.amount
FROM GroupTest G0
INNER JOIN
(SELECT office, startDate, max(status) maxStatus
FROM GroupTest GROUP BY office, startDate) G1
ON G0.office = G1.office
AND G0.startDate = G1.startDate
AND G0.status = G1.maxStatus
order by G0.office, G0.startDate
But that's not the case. I asked the customer what to do. For their
purposes, the report will be fine if it can show them an "illustrative"
row--in other words, if more than one row in the table matches a given
combination {office, startDate, status}, the query should return one of
them arbitrarily. But I'm not figuring out how to do that. I guess I'd
like to figure out how to retrieve the "maximum row" for each {office,
startDate} combination, or something similar. Can anyone help?
I could punt and go with just displaying the maximum over each of the
columns on the right-hand side (status, endDate, reportDate, amount),
each taken independently:
SELECT
G0.office, G0.startDate, G0.status,
G0.endDate, G0.reportDate, G0.amount
FROM GroupTest G0
INNER JOIN
(SELECT office, startDate, max(status) maxStatus,
max(endDate) maxEndDate,
max(reportDate) maxReportDate,
max(amount) maxAmount
FROM GroupTest GROUP BY office, startDate) G1
ON G0.office = G1.office
AND G0.startDate = G1.startDate
AND G0.status = G1.maxStatus
AND G0.endDate = G1.maxEndDate
AND G0.reportDate = G1.maxReportDate
AND G0.amount = G1.maxAmount
order by G0.office, G0.startDate
But the rows produced by that query aren't "coherent": For a given
{office, startDate} combination, the status could be from one row, the
startDate could be from another, the endDate from another, etc. Each row
in my query should match an actual row in the table.I've moved on from my previous question, having figured out an approach.
However, I'm stuck on that approach because I'm getting unexpected
results. I'm asking about that in a new thread.

Monday, February 13, 2012

"Display Dependencies" not showing all dependencies

Within Sql Server Enterprise, I click on an object to show dependencies, and
there is something I am not seeing here.
For example, I want to see all dependencies for a given table. It shows a
view and a couple of stored procedures that perform SELECT statements.
However, there is a stored procedure that performs UPDATE and INSERT against
that particular table, but I am not seeing on in the Display Dependencies
screen.
When I attempt to see the Dependencies screen on the stored procedure that
does UPDATE and INSERT, I am not seeing the table listed.
There seems to be a disconnect some place either in my head or in Enterprise
Manager. What am I missing? How can I display, all, I mean ALL
dependencies? For a given table, I want stored procedures listed if they do
ANYTHING on the table. And views. And functions. All dependencies,
period. How can I do that?
Because of deferred name resolution and other factors, then you won't
necessarily see all dependencies (e.g. depending on the order the objects
were created). I think one way to solve would be to recompile the stored
procedures, but I still don't think that will guarantee all dependencies
will show up... there are other things that aren't captured by sp_depends,
e.g. dynamic SQL.
http://www.aspfaq.com/
(Reverse address to reply.)
"David C" <nospam@.nospam.com> wrote in message
news:0oh6d.21182$OB2.1947@.twister.socal.rr.com...
> Within Sql Server Enterprise, I click on an object to show dependencies,
and
> there is something I am not seeing here.
> For example, I want to see all dependencies for a given table. It shows a
> view and a couple of stored procedures that perform SELECT statements.
> However, there is a stored procedure that performs UPDATE and INSERT
against
> that particular table, but I am not seeing on in the Display Dependencies
> screen.
> When I attempt to see the Dependencies screen on the stored procedure that
> does UPDATE and INSERT, I am not seeing the table listed.
> There seems to be a disconnect some place either in my head or in
Enterprise
> Manager. What am I missing? How can I display, all, I mean ALL
> dependencies? For a given table, I want stored procedures listed if they
do
> ANYTHING on the table. And views. And functions. All dependencies,
> period. How can I do that?
>
|||So do you have a suggestion?
I would like to re-engineer a table (changing a column type), so I need to
find all objects that talk to this table.
If "Display Dependencies" does not do what it's supposed to, then what
purpose does it serve other than giving partial answers?
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:uZaO$RYpEHA.1960@.TK2MSFTNGP10.phx.gbl...
> Because of deferred name resolution and other factors, then you won't
> necessarily see all dependencies (e.g. depending on the order the objects
> were created). I think one way to solve would be to recompile the stored
> procedures, but I still don't think that will guarantee all dependencies
> will show up... there are other things that aren't captured by sp_depends,
> e.g. dynamic SQL.
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "David C" <nospam@.nospam.com> wrote in message
> news:0oh6d.21182$OB2.1947@.twister.socal.rr.com...
> and
> against
> Enterprise
> do
>
|||> If "Display Dependencies" does not do what it's supposed to, then what
> purpose does it serve other than giving partial answers?
In some scenarios, it does give the right answer (e.g. if you compile all of
your stored procedures after all their dependent objects have been created,
don't alter anything, and don't use dynamic SQL).
For all other scenarios, my only suggestion is to parse the text from
syscomments or INFORMATION_SCHEMA.ROUTINES for the name of your table.
And please remember, the people here are merely trying to help you. We did
not design SQL Server, have no control over the dependencies functionality,
and can't explain why they bothered putting it into the product.
http://www.aspfaq.com/
(Reverse address to reply.)
|||
> In some scenarios, it does give the right answer (e.g. if you compile all
> of
> your stored procedures after all their dependent objects have been
> created,
> don't alter anything, and don't use dynamic SQL).
>
How does one recompile all the stored procedures with one command? Is there
a way to do that? How about Views and User functions?
> For all other scenarios, my only suggestion is to parse the text from
> syscomments or INFORMATION_SCHEMA.ROUTINES for the name of your table.
> And please remember, the people here are merely trying to help you. We
> did
> not design SQL Server, have no control over the dependencies
> functionality,
> and can't explain why they bothered putting it into the product.
Your point is well taken.
|||> How does one recompile all the stored procedures with one command?
If you alter one table, do you have to recompile all stored procedures?
Unlikely.

> How does one recompile all the stored procedures with one command? Is
there
> a way to do that? How about Views and User functions?
This will generate the command for procs and functions, but not run it.
SELECT
CHAR(13)+CHAR(10)+'EXEC sp_recompile '''+ROUTINE_NAME+''';'
+CHAR(13)+CHAR(10)+'EXEC '+ROUTINE_NAME+';'
+CHAR(13)+CHAR(10)+'GO;'
FROM
INFORMATION_SCHEMA.ROUTINES
For views,
SELECT
CHAR(13)+CHAR(10)+'EXEC sp_recompile '''+TABLE_NAME+''';'
+CHAR(13)+CHAR(10)+'EXEC '+TABLE_NAME+';'
+CHAR(13)+CHAR(10)+'GO;'
INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE='view'
In both cases, use Query Analyzer with results to text. Run the code, and
copy the output from the bottom pane to the upper pane or a new window. You
may want to add filters to leave out system or other specific objects.
Keep in mind that this still does not guarantee that sp_depends or some GUI
red herring like "Display Dependencies" will work flawlessly, because of
other factors I mentioned earlier.
http://www.aspfaq.com/
(Reverse address to reply.)

"Display Dependencies" not showing all dependencies

Within Sql Server Enterprise, I click on an object to show dependencies, and
there is something I am not seeing here.
For example, I want to see all dependencies for a given table. It shows a
view and a couple of stored procedures that perform SELECT statements.
However, there is a stored procedure that performs UPDATE and INSERT against
that particular table, but I am not seeing on in the Display Dependencies
screen.
When I attempt to see the Dependencies screen on the stored procedure that
does UPDATE and INSERT, I am not seeing the table listed.
There seems to be a disconnect some place either in my head or in Enterprise
Manager. What am I missing? How can I display, all, I mean ALL
dependencies? For a given table, I want stored procedures listed if they do
ANYTHING on the table. And views. And functions. All dependencies,
period. How can I do that?Because of deferred name resolution and other factors, then you won't
necessarily see all dependencies (e.g. depending on the order the objects
were created). I think one way to solve would be to recompile the stored
procedures, but I still don't think that will guarantee all dependencies
will show up... there are other things that aren't captured by sp_depends,
e.g. dynamic SQL.
--
http://www.aspfaq.com/
(Reverse address to reply.)
"David C" <nospam@.nospam.com> wrote in message
news:0oh6d.21182$OB2.1947@.twister.socal.rr.com...
> Within Sql Server Enterprise, I click on an object to show dependencies,
and
> there is something I am not seeing here.
> For example, I want to see all dependencies for a given table. It shows a
> view and a couple of stored procedures that perform SELECT statements.
> However, there is a stored procedure that performs UPDATE and INSERT
against
> that particular table, but I am not seeing on in the Display Dependencies
> screen.
> When I attempt to see the Dependencies screen on the stored procedure that
> does UPDATE and INSERT, I am not seeing the table listed.
> There seems to be a disconnect some place either in my head or in
Enterprise
> Manager. What am I missing? How can I display, all, I mean ALL
> dependencies? For a given table, I want stored procedures listed if they
do
> ANYTHING on the table. And views. And functions. All dependencies,
> period. How can I do that?
>|||So do you have a suggestion?
I would like to re-engineer a table (changing a column type), so I need to
find all objects that talk to this table.
If "Display Dependencies" does not do what it's supposed to, then what
purpose does it serve other than giving partial answers?
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:uZaO$RYpEHA.1960@.TK2MSFTNGP10.phx.gbl...
> Because of deferred name resolution and other factors, then you won't
> necessarily see all dependencies (e.g. depending on the order the objects
> were created). I think one way to solve would be to recompile the stored
> procedures, but I still don't think that will guarantee all dependencies
> will show up... there are other things that aren't captured by sp_depends,
> e.g. dynamic SQL.
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "David C" <nospam@.nospam.com> wrote in message
> news:0oh6d.21182$OB2.1947@.twister.socal.rr.com...
>> Within Sql Server Enterprise, I click on an object to show dependencies,
> and
>> there is something I am not seeing here.
>> For example, I want to see all dependencies for a given table. It shows
>> a
>> view and a couple of stored procedures that perform SELECT statements.
>> However, there is a stored procedure that performs UPDATE and INSERT
> against
>> that particular table, but I am not seeing on in the Display Dependencies
>> screen.
>> When I attempt to see the Dependencies screen on the stored procedure
>> that
>> does UPDATE and INSERT, I am not seeing the table listed.
>> There seems to be a disconnect some place either in my head or in
> Enterprise
>> Manager. What am I missing? How can I display, all, I mean ALL
>> dependencies? For a given table, I want stored procedures listed if they
> do
>> ANYTHING on the table. And views. And functions. All dependencies,
>> period. How can I do that?
>>
>|||> If "Display Dependencies" does not do what it's supposed to, then what
> purpose does it serve other than giving partial answers?
In some scenarios, it does give the right answer (e.g. if you compile all of
your stored procedures after all their dependent objects have been created,
don't alter anything, and don't use dynamic SQL).
For all other scenarios, my only suggestion is to parse the text from
syscomments or INFORMATION_SCHEMA.ROUTINES for the name of your table.
And please remember, the people here are merely trying to help you. We did
not design SQL Server, have no control over the dependencies functionality,
and can't explain why they bothered putting it into the product.
--
http://www.aspfaq.com/
(Reverse address to reply.)|||> In some scenarios, it does give the right answer (e.g. if you compile all
> of
> your stored procedures after all their dependent objects have been
> created,
> don't alter anything, and don't use dynamic SQL).
>
How does one recompile all the stored procedures with one command? Is there
a way to do that? How about Views and User functions?
> For all other scenarios, my only suggestion is to parse the text from
> syscomments or INFORMATION_SCHEMA.ROUTINES for the name of your table.
> And please remember, the people here are merely trying to help you. We
> did
> not design SQL Server, have no control over the dependencies
> functionality,
> and can't explain why they bothered putting it into the product.
Your point is well taken.|||> How does one recompile all the stored procedures with one command?
If you alter one table, do you have to recompile all stored procedures?
Unlikely.
> How does one recompile all the stored procedures with one command? Is
there
> a way to do that? How about Views and User functions?
This will generate the command for procs and functions, but not run it.
SELECT
CHAR(13)+CHAR(10)+'EXEC sp_recompile '''+ROUTINE_NAME+''';'
+CHAR(13)+CHAR(10)+'EXEC '+ROUTINE_NAME+';'
+CHAR(13)+CHAR(10)+'GO;'
FROM
INFORMATION_SCHEMA.ROUTINES
For views,
SELECT
CHAR(13)+CHAR(10)+'EXEC sp_recompile '''+TABLE_NAME+''';'
+CHAR(13)+CHAR(10)+'EXEC '+TABLE_NAME+';'
+CHAR(13)+CHAR(10)+'GO;'
INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE='view'
In both cases, use Query Analyzer with results to text. Run the code, and
copy the output from the bottom pane to the upper pane or a new window. You
may want to add filters to leave out system or other specific objects.
Keep in mind that this still does not guarantee that sp_depends or some GUI
red herring like "Display Dependencies" will work flawlessly, because of
other factors I mentioned earlier.
--
http://www.aspfaq.com/
(Reverse address to reply.)

Saturday, February 11, 2012

"Completing" a time phased table

Hi everyone,
I Need to display summarized, time phased (lets say wly), data in a
datagrid. Pretty straightforward except that my summarized data may or may
not be "complete". That is if I do a simple summarization query on my base
data I won't get a record for every w. In my DataGrid, if there are no
transactions, I need to show a '0' for that w.
Right now I'm planning doing the following...
1) Create another table that has the same layout as my base data table,
with one record per w and a zero value.
2) Summarizing my main data table by w, and then merging it (using
UNION) with my created "zero value" table.
3) Quering the merged tables and sumarizing by w. Where there is
overlap, the extra records from my created table add nothing to value. Wher
e
there is no base data for that w, the "zero value table" record will be
returned.
So it looks something like this (much simplified)...
SELECT SUM(Value), MAX(Period) FROM ((SELECT SUM(Value), MAX(Period) FROM
Base Group by Period) UNION ZeroTable) GROUP BY Period
Is there an easier way to do this?
Thanks.
BBMDo you have a table of the periods? If not, create one. Then you can do
this:
SELECT SUM(T.x), SUM(T.y), SUM(T.z)
FROM PeriodCalendar AS P
LEFT JOIN YourTable AS T
ON P.period = T.period
WHERE ...?
GROUP BY P.period ;
Turning the NULLs into zeros is just a matter of presentational
formatting. If you want to do it in the quer then wrap each sum with
COALESCE(..., 0).
David Portas
SQL Server MVP
--|||create table ws(date_from smalldatetime, date_to smalldatetime)
insert into ws values('7-31-2005','8-7-2005')
insert into ws values('8-7-2005','8-14-2005')
insert into ws values('8-14-2005','8-21-2005')
create table payments(pmt_date smalldatetime, amt money)
insert into payments values('8-2-2005',123.45)
insert into payments values('8-3-2005',12.5)
insert into payments values('8-20-2005',123.45)
insert into payments values('8-21-2005',123.45)
select convert(varchar(11), date_from) date_from,
convert(varchar(11), date_to) date_to,
(select sum(amt) from payments where pmt_date>=date_from and
pmt_date<date_to) wum_pmt
from ws
date_from date_to wum_pmt
-- -- --
Jul 31 2005 Aug 7 2005 135.9500
Aug 7 2005 Aug 14 2005 NULL
Aug 14 2005 Aug 21 2005 123.4500
drop table ws
drop table payments|||Thanks David.
Yes I do have a period table, but my problem is a little more complex than
in my original post. In actuality, there are multiple values in each period
by "category".
I do have control over the period table (I'm actually using a copy of the
real table with some extra fields in it) so I could add a record in my perio
d
table for each category (there are only six).
Is there an easier way to do this? (create a category table and use it to
create a cross product table as the left side of my JOIN? I'll try this)
COALESCE is VERY handy. Thanks for the tip.
Thanks again.
"David Portas" wrote:

> Do you have a table of the periods? If not, create one. Then you can do
> this:
> SELECT SUM(T.x), SUM(T.y), SUM(T.z)
> FROM PeriodCalendar AS P
> LEFT JOIN YourTable AS T
> ON P.period = T.period
> WHERE ...?
> GROUP BY P.period ;
> Turning the NULLs into zeros is just a matter of presentational
> formatting. If you want to do it in the quer then wrap each sum with
> COALESCE(..., 0).
> --
> David Portas
> SQL Server MVP
> --
>|||Thanks AK. Very elegant. Using a Select statement to calculate the value
of the returned row is clever. Are there any performance implications?
BBM
"AK" wrote:

> create table ws(date_from smalldatetime, date_to smalldatetime)
> insert into ws values('7-31-2005','8-7-2005')
> insert into ws values('8-7-2005','8-14-2005')
> insert into ws values('8-14-2005','8-21-2005')
> create table payments(pmt_date smalldatetime, amt money)
> insert into payments values('8-2-2005',123.45)
> insert into payments values('8-3-2005',12.5)
> insert into payments values('8-20-2005',123.45)
> insert into payments values('8-21-2005',123.45)
> select convert(varchar(11), date_from) date_from,
> convert(varchar(11), date_to) date_to,
> (select sum(amt) from payments where pmt_date>=date_from and
> pmt_date<date_to) wum_pmt
> from ws
> date_from date_to wum_pmt
> -- -- --
> Jul 31 2005 Aug 7 2005 135.9500
> Aug 7 2005 Aug 14 2005 NULL
> Aug 14 2005 Aug 21 2005 123.4500
> drop table ws
> drop table payments
>|||It seems to me that David's solution and AK's solution are
basically equivalent, the only difference being that each of them
made different assumptions about the structure of your tables, which
you didn't provide. Can you be more specific about why David's
solution does not meet your requirements, and this one does?
Here is what David's solution would look like using the tables
AK provided:
select
convert(varchar(11), date_from) as date_from,
convert(varchar(11), date_to) as date_to,
coalesce(sum(amt),$0) as wum_pmt
from ws left outer join payments
on pmt_date >= date_from
and pmt_date < date_to
group by date_from, date_to
Steve kass
Drew University
BBM wrote:
>Thanks AK. Very elegant. Using a Select statement to calculate the value
>of the returned row is clever. Are there any performance implications?
>BBM
>"AK" wrote:
>
>

"colspan" functionality in a table?

I want to display a label and some column totals in the footer of a table. The label text is wider than any column in my table. Is there some way to tell a table column that I want it to span more than one column? I do not want the footer column to expand because it causes the whole table column to expand.

The Sum function is only valid within the body section so I cannot move the totals to the page or report footer. I cannot make them seperate text boxes from the table since it expands and I want them at the bottom without any seperation.

The only solution I could come up with is to make a subreport with the same query, just totals, and put it after the first. This offends my sense of esthetics. There has to be a more elegant solution.

TIASelect the multiple columns, right click, and choose Merge Cells.