Showing posts with label row. Show all posts
Showing posts with label row. Show all posts

Tuesday, March 27, 2012

Failed to manage image field

In my simple table in MSDE 2000A, I have an image field. I have enabled 'text in row' using the stored procedure 'sp_tableoption'.

How do I get jpeg images in the table, and how do I read them?

Now, I ask a naive question. Has anybody ever captured an image from the file system, and saved it in SQL 2000 (or MSDE 2000A, which I am using for development)?

If you don't save image direct to database, how do you manage yor images stored seperate from the database (i.e on the filesystem)

For the last two days, I have searched the net and I regret to say I am not making any headway. Lots of stuff on the net have not been very useful.

Please help. How did you do yours? If it matters, I am using VB .NET 2003 front-end. Let me know whatever method you used.

I am desperate.

|||

Finally done!

I used the MemoryStream conversion to Byte then saved to table. To retrieve, I used the converse.

Friday, March 23, 2012

Failed to enable constraints

I have to admit I'm pretty new to ASP.net.

I'm trying to insert a row of data into my SQLExpress database table "Prets"

I'm getting the user_ID from the table "Membres"

Here's the code I have:

Imports System.Web.UI.Page
Imports System.Security.Principal
Imports WiseNetTableAdapters

PartialClass membre_sec_Pret_demande_pret
Inherits System.Web.UI.Page

Protected Sub submit_btn_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles submit_btn.Click
Dim UserAs String = My.User.Name
Dim pretAdapterAs New PretsTableAdapter
Dim membreAdapterAs New MembresTableAdapter
pretAdapter.AjouterPret(Convert.ToInt32(membreAdapter.GetUserIDbyName(User)), Convert.ToDecimal(montant_txt.Text), Convert.ToString(raison_txt.Text))
End Sub
End Class

And here's the error I get at runtime:

Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

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.Data.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Source Error:

Line 1610: }Line 1611: WiseNet.MembresDataTable dataTable = new WiseNet.MembresDataTable();Line 1612: this.Adapter.Fill(dataTable);Line 1613: return dataTable;Line 1614: }


Source File:c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\wisenetindustries\afc388c7\16067f12\App_Code.tyietv41.0.cs Line:1612

Stack Trace:

[ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.] System.Data.DataTable.EnableConstraints() +1820725 System.Data.DataTable.set_EnforceConstraints(Boolean value) +39 System.Data.DataTable.EndLoadData() +138 System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) +218 System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) +318 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +221 System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +162 System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +107 WiseNetTableAdapters.MembresTableAdapter.GetUserIDbyName(String nom) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\wisenetindustries\afc388c7\16067f12\App_Code.tyietv41.0.cs:1612 membre_sec_Pret_demande_pret.submit_btn_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\WiseNetIndustries\membre_sec\Pret\demande_pret.aspx.vb:12 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

Make sure you have not insert duplicate values on the primary key column, you may take a look at this post:

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

sql

Monday, March 19, 2012

Failed insert via Enterprise Manager

Hey guys..

Trying to insert a row via Enterprise Manager I get "object does not exist" error.. However it works on another server?!?

The table name is aa.aabc .. So i know what the problem is.. it thinks that aa is the owner.. I can insert using query analyzer by using the following syntax: insert into [aa.aabc] ... but it fails using: insert into aa.abc .. for obvious reasons..

I'm guessing it has something to do with the differences in the server config between the 2 servers as to why one server you can insert via enterprise manager and the other you cant..

The collation is different as the ANSI warning and padding in the connection info..

Can anyone else help me fix this problem, so that I can insert using enterprise manager?

CheersINSERT into EM Where?|||Databases --> Databasename --> Tables --> Tablename --> Return all rows.. Then you can scroll to the bottom row and insert in a similar way to access..

THanks

failed insert because of duplicate rows and still locks held by application

Hi,
we are using SQL Server 2005.
We have a problem because of an application which tries to
insert a duplicate row in a table with primary key. This insert fails
of course but the locks are not released within this transcation.

This is not locking up on MS SQL Server 2000. But we can see the lock is still applied there.

Can someone help me on this?

Thanks,

Hmmm. What locks are held by the INSERT? Is this a stored procedure you are calling?

Can you post the code you are calling? It sounds like you might be in a Serializable isolation level, perhaps, and an explicit transaction is being started but not cleared. Are you using connection pooling?

|||We are not using connection pooling. The application is written in 'C' langugage and we are using Standard ODBC drivers provided by Microsoft. There are no explicit locking done for this insert query. After failure if I commit or rollback the lock gets released. I can see locks are also held in MS SQL Server 2000 also but they are not blocking other users to accress that perticular table. I have not chnaged isolation level in both (MS SQL Server 2005 and MS SQL Server 2000). The same application also runs with Oracle 9i and on failure of insert statment dos not locking oracle table. I am trying to figure out what locking mechanisum is changed in MS SQL Server 2005. Do I need to change any default settings in MS SQL Server 2005 which will not lock the table on failure of insert because of duplicate rows.|||

Try looking at the output of this query:

select login_name,
case des.transaction_isolation_level
when 0 then 'Unspecified' when 1 then 'ReadUncomitted'
when 2 then 'ReadCommitted' when 3 then 'Repeatable'
when 4 then 'Serializable' when 5 then 'Snapshot'
end as transaction_isolation_level,
request_session_id, resource_type, resource_subtype, request_mode,

request_type, request_status, request_owner_type,
case when resource_type = 'object' then object_name(resource_associated_entity_id)
when resource_type = 'database' then db_name(resource_associated_entity_id)
when resource_type in ('key','page') then

(select object_name(object_id) from sys.partitions

where hobt_id = resource_associated_entity_id)
else cast(resource_associated_entity_id as varchar(20))
end
from sys.dm_tran_locks dtl
left outer join sys.dm_exec_sessions des
on dtl.request_session_id = des.session_id
where request_session_id <> @.@.spid

and this:

select der.session_id, der.wait_type, der.wait_time,
der.status as requestStatus,
des.login_name,
cast(db_name(der.database_id) as varchar(30)) as databaseName,
des.program_name,

der.command as commandType,

execText.text as objectText,
case when der.statement_end_offset = -1 then '--see objectText--'
else SUBSTRING(execText.text, der.statement_start_offset/2,
(der.statement_end_offset - der.statement_start_offset)/2)
end AS currentExecutingCommand,

der.open_transaction_count
from sys.dm_exec_sessions des
join sys.dm_exec_requests as der
on der.session_id = des.session_id
cross apply sys.dm_exec_sql_text(der.sql_handle) as execText
where des.session_id <> @.@.spid --eliminate the current connection

to see if you have a statement executing and

See what kinds of locks are being held and what the isolation level is. It is probably just not being disconnected and has a transaction open. Then try profiler to see exactly what is being sent. There is likely a setting that you need to set, but without seeing the code this is not easy to do.

|||

Thanks for reply.

The first query is giving follwing result:

Login Tran_Isolation re_ses resource_type mode type Status Owner Table

sasi ReadCommitted 56 PAGE IX LOCK GRANT TRANSACTION ACLS6999
sasi ReadCommitted 56 KEY X LOCK GRANT TRANSACTION ACLS6999
sasi ReadCommitted 56 KEY X LOCK GRANT TRANSACTION ACLS6999
sasi ReadCommitted 56 RID X LOCK GRANT TRANSACTION 72057594243186688
sasi ReadCommitted 56 PAGE IX LOCK GRANT TRANSACTION ACLS6999
sasi ReadCommitted 56 KEY X LOCK GRANT TRANSACTION ACLS6999
sasi ReadCommitted 56 KEY X LOCK GRANT TRANSACTION ACLS6999
sasi ReadCommitted 56 KEY X LOCK GRANT TRANSACTION ACLS6999
sasi ReadCommitted 56 KEY X LOCK GRANT TRANSACTION ACLS6999
sasi ReadCommitted 56 OBJECT IX LOCK GRANT TRANSACTION ACLS6999

The second query is not returning any rows.

|||I think you are going to have to use profiler and trace the activity on your server for this process. Post the queries if you can and then we can see what might be wrong.

Wednesday, March 7, 2012

Fact table design problem

Hello All,

I have a row for each employee, each month in my fact table.

EmployeeID DateKey Other Dimensions... 1 20060101 2 20060101 1 20060201 2 20060201

I need to include bonus information. The problem is, for each month a person may have received more than one bonus amount and type in a month. In some cases they have gotten the same bonus twice in the same month. For example:
EmployeeID DateKey Bonus Bonus Type
1 20060105 $5,000 Team
1 20060107 $500 GoodJob
1 20060110 $250 Incentive

How can I have multiple bonuses and their amounts in the fact table if I only have a single row for each employee?


Thank you for the help, this has been driving me crazy.

-Gumbatman

p.s. I've tried stuff with many-to-many dimensions and also Factless Fact tables to get this, but it is just not working for me. I read Mark Russo's very good article about many-to-many dimensions but I am not 100% that it applies to what I am doing.

Hello! I am not sure that I understand the problem fully but have you tried to add a bonus type dimension.

With a bonus type key, an employee key and a date key you should be able to do the analysis you are describing.

All these relations would be one-to-many from the dimension tables.

HTH

Thomas Ivarsson

|||

Thomas,

Thank you for responding.

Are you saying keep the Bonus amounts (the facts) in the main Fact table or have a secondary fact table?

If it is in the main fact table, how do I connect the Bonus dimension to the fact table when there are multiple bonuses inside a month (which is the grain of that fact table)?

I tried using a Bonus fact table that connects to the main fact table via a DateKey and EmployeeKey. Then I connect the Bonus Dimension to the Bonus fact table. In order to get the Bonus Dimension to be "seen" by the main fact table, I am using a many-to-many connection.

The problem I am having there is I have a Geography Dimension connected only to the main fact table, not the Bonus fact table. I can't seem to get the Geography Dimension to work properly. What I mean by that is that the Bonus numbers show up for everyone, regardless of Geography.

Please let me know if I am not explaining this clearly. I really appreciate the help (and I really need the help). I've gotten to the point were I am ready to hire a consultant on this issue alone.

-Gumbatman

|||

Perhaps you are talking about something not previously known in your first post.

I do not think that you will need two fact tables for this problem. I am thinking about one fact table with one measure like Amount.

The dimension tables will be time, employee and bonustype. If an employee receive the same type of bonus twice on a single day you can aggregate these recordss into one, with Integration Services.

HTH

Thomas Ivarsson

|||

Sorry if I didn't mention stuff clearly in my first post. There is a lot to this issue that I may have forgotten to mention.

However, I am curious about your IS suggestion. I can certainly aggregate the amount into the single row. But how do I show that a person received multiple bonuses in that month?

For example, the Bonus Dimension looks like this:

BonusID BonusType BonusAmount

1 Thank You 50

2 Applause 100

3 Encore 250

On a single row, the employe received two Thank Yous and an Applause - a total of 200. Should my Dimension table look like it does? And this prompts another question, can I do a calculation from a Dimension table?

Thank you again for your help.

-Gumbatman

|||

Hello. I would move the BonusAmount to the fact table and keep BonusId and BonusType in the dimension table.

You do all calculations in the fact table.

Your single fact table will look like this

EmployeeId

BonusId

BonusDate

BonusAmount

HTH

Thomas Ivarsson

|||

Thomas,

Is the Fact table you are suggesting here, a secondary one to the "main" fact table? If so, what is the best way to link the two fact tables, since the data needs to be summarized by month?

If you are suggesting putting the bonus data in the main table, do I just repeat some of the other Dimensions? For example, here is what I am thinking would be my main fact table with bonus information for a single employee in one month:

Employee Key Date Key Geography Key Salary Bonus Amount Bonus Key 1 20060101 55 50,000 50 1 1 20060101 55 0 250 2 1 20060101 55 0 500 3

Since it is additive by month, I have to zero-out the Salary for the additional rows.(At least that is my guess.)

Thank you.

-Gumbatman

|||

No! Only one fact table.

I see that you have a salary measure as well and that it will repeat for all bonus records and that the granularity is actually on a month level?

If this is the case I suggest that you make each bonus type a separate measure and aggregate them to the same level as the salary(month?)

So if the same bonus appears several times during a month it will be aggregated into one single bonus type measure.

HTH

Regards

Thomas Ivarsson

|||

OK. I think I got it now.

But if I add each bonus as a separate measure in the fact table, what happens if a new bonus type appears?

Thank you.

-Gumbatman

|||

It will be a new measure.

HTH

Thomas Ivarsson

|||

Sorry, I should have been more specific...

What is the best way to handle a new measure coming into the Fact table, through Integration Services? I guess I check and then append new columns when a new bonus measure is created?

Also, if I do it by measures, what happens to the Bonus Dimension? I will need to slice and dice by the Bonus types. I am unclear about how I can still show who got a what bonus type, especially if there was more than one in that monthly row.

Thank you again (and for your patience).

-Gumbatman

Fact Snapshot Table Question

Hello All,

I have a Snapshot Fact table that shows data on a monthly basis. Each person has a row for each month.
But now I am adding bonus information. The problem is, for each month a person may have received more than one bonus amount and type in a month. For example:
ID Date Bonus Bonus Type
1000 1/1/2000 $5,000 Team
1000 1/5/2000 $ 500 GoodJob
1000 1/7/2000 $ 250 Incentive

What is the best way to have multiple bonuses and their amounts in the fact table, (when the fact table currently has a single row per employee, per month)?


Thank you for the help.

-Gumbatman

Assuming that you are using SSAS 2005, Just keep this information in it's own fact table and add that to the cube as another measure group.|||

Darren,

Thank you for the reply, but I am not 100% clear on what you mean (my issue, not yours).

I have my main fact table, that is populated each month, for example:

EmployeeID DateKey JobKey GeographicKey 1 20060101 123 455 2 20060101 3247 9898 3 20060101 9870 2444 1 20060201 987 455 2 20060201 3247 9898 3 20060201 9870 2444

If I now have the bonus information as a separate table, how would I link them in order to add the bonus information as a Measure Group?

Do I need to have the JobKey and GeographicKeys in the Bonus fact table to do my slicing by dimensions (seems redundant)?

Taking a guess, I assume my Bonus fact table should it look something like this:

EmployeeID DateKey BonusAmount BonusKey 1 20060101 500 55 1 20060101 1000 42 1 20060101 250 3 3 20060101 500 55 2 20060201 250 68

My assumption is to link the two fact tables by DateKey and EmployeeID.

Thank you for the help. I've been trying to get my brain around this for a while.

|||

Having different granularities can make things a bit harder to get your head around. If you have a look at the Adventure Works cube you will see that the sales targets measure group is probably similar to bonus fact table we are talking about here.

The answer to your question hinges around how you want to see the data come out like the following, with the bonus essentially repeated for each unrelated attribute (ie Job and Geography).

EmployeeID DateKey JobKey GeographicKey Bonus 1 20060101 123 455 2000 2 20060101 3247 9898 250 3 20060101 9870 2444 500 1 20060201 987 455 2000 2 20060201 3247 9898 250 3 20060201 9870 2444

500

Then simply adding the bonus fact table to the cube and setting up the dimension relationships tab so that only the date and employee dimensions are related to the bonus amounts should be enough. You can also change a setting on the measure group so that if someone drills down by an unrelated dimension then the bonus amount returns null.

Those are the two default options, the only other option I can think of would be to devise an allocation mechanism to divide the bonus between the unrelated attributes like Job and Geography which would involve either extra work in the ETL phase or calculations in the MDX script.

|||

Darren,

Thank you so much for the answers and explanations. I still need to get my head around how the Sales Targets measure group is related, but it certainly seems to be what I was looking for.

I really appreciate you taking the time to answer this for me. You've saved me lots of time and work trying to figure it out on my own (which probably wouldn't have happened).

-Gumbatman

|||

Darren,

I've tried implementing this, but I am not doing something correctly.

I have my Fact table:

RowKey EmployeeKey Date 1 500 20061031 2 600 20061031 3 700 20061031 4 500 20061130 5 600 20061130 6 700 20061130

And my Bonus Fact Table, which references the RowKey:

RowKey BonusAmount Date 1 250 20061031 1 700 20061031 6 1000 20061130 6 2000 20061130

As you can see, Employee 500 got two bonuses in October and Employee 700 got two bonuses in November.

I linked the two Fact tables in the Data Source View (using RowKey) and added a new Measure Group. In the Dimensions tab, I can only connect the Date to the Time Dimension. I don't know how to connect the tables other than that since the Bonus Fact table doesn't have those dimensions.

When I Browse the cube, the Bonus amounts do show over time, but the total populates all the rows. For example,

Period 1 Period 2 Period 3 Midwest 50,000 98,000 45,000 Northeast 50,000 98,000 45,000 Southwest 50,000 98,000 45,000

How do I connect the two fact tables so I can use all the Dimensions that are already connected to the main Fact table? I did try the many-to-many connection but that didn't help either.

Thank you for the help.

-Gumbatman

Friday, February 24, 2012

Extremely complex Select statement

Hello,
I'm having real problems defining a SELECT statement for
the following scenario:
I have a Requirements table, each row in this table has
at least 1 row in the RequirementsWeeks table which
defines values for N weeks for each requirement.
Also, each requirement has a product value and a tool
value and each product belongs to a prodCategory and each
tool belongs to a ToolCategory (these associations are
stored in separate tables)
Here's an example of the records I have:
Requirements: RequirementsWeeks:
Product Tool Id ReqId Week Value
A TA 1 1 8 0.20
C TB 2 1 9 0.35
2 8 2.56
2 9 3.52
Products: Tools:
Id ProductName ProCategoryID Id ToolName ToolCatID
1 A 45 1 TA 68
2 B 53 2 TB 68
3 C 45
What i want to have is:
For all pairs product-tool in requirements that matches
ToolCatID And ProdCatID return the sum for week N
For example:
ToolCatID:68 And ProdCatID:45 the sum will return 0.20 +
2.56
And I need this to be done for All posible combinations
of ToolCatID and ProdCatID.
Any thoughts? I don't want to loop through a single SQL
statement that receives toolCat and prodCat as parameters,
I thought there's a way for SQL to manage this.
Thank you a lot for your time! I'm really desperate!Yes, exactly. Thanks a lot for your time, I've already
found a solution, which is to divide the problem in two
parts: The statement to select each row, and the one to
select that for all possible combinations of toolcat and
product cat(which was a very easy select). This seems to
work well but if you have a better idea please let me know.
Thank you so much for your time!! I really appreciate it!
Marcela
>--Original Message--
>So based on your example is this what you want the output
to be
>Toolcatid ProDCatID Sum Week
>68 45 0.2 + 2.56 8
>68 45 0.35+3.52 9
>68 53 0.2 + 2.56 8
>68 53 0.35+3.52 9
>
>"Marcela" <marcela.villalobos@.yahoo.com> wrote in message
>news:057b01c35bb1$af9e9310$a401280a@.phx.gbl...
>> Hello,
>> I'm having real problems defining a SELECT statement
for
>> the following scenario:
>> I have a Requirements table, each row in this table has
>> at least 1 row in the RequirementsWeeks table which
>> defines values for N weeks for each requirement.
>> Also, each requirement has a product value and a tool
>> value and each product belongs to a prodCategory and
each
>> tool belongs to a ToolCategory (these associations are
>> stored in separate tables)
>> Here's an example of the records I have:
>> Requirements: RequirementsWeeks:
>> Product Tool Id ReqId Week Value
>> A TA 1 1 8 0.20
>> C TB 2 1 9 0.35
>> 2 8 2.56
>> 2 9 3.52
>> Products: Tools:
>> Id ProductName ProCategoryID Id ToolName
ToolCatID
>> 1 A 45 1 TA 68
>> 2 B 53 2 TB 68
>> 3 C 45
>>
>> What i want to have is:
>> For all pairs product-tool in requirements that matches
>> ToolCatID And ProdCatID return the sum for week N
>> For example:
>> ToolCatID:68 And ProdCatID:45 the sum will return
0.20 +
>> 2.56
>> And I need this to be done for All posible combinations
>> of ToolCatID and ProdCatID.
>> Any thoughts? I don't want to loop through a single SQL
>> statement that receives toolCat and prodCat as
parameters,
>> I thought there's a way for SQL to manage this.
>> Thank you a lot for your time! I'm really desperate!
>>
>
>.
>

Friday, February 17, 2012

Extract value from table footer row and display in separate textbo

Hello,
I need to display a percentage calculation from some values in a table
footer row, and I want to display that in a separate textbox not in the
Report table. I hope this can be done simply without having to create an
additional dataset and display the value from the additional dataset. Is it
possible to read values from the Report table and display those values in a
separate textbox? How to do this? Can I write a function in the code window
and read from that? I guess I will find out.
Any suggestions appreciated on a technique to read values (aggregated values
say - from the dataset) via a function in the code window so that I can
display the resulting value in a separate textbox.
Thanks,
RichOn Apr 9, 4:54 pm, Rich <R...@.discussions.microsoft.com> wrote:
> Hello,
> I need to display a percentage calculation from some values in a table
> footer row, and I want to display that in a separate textbox not in the
> Report table. I hope this can be done simply without having to create an
> additional dataset and display the value from the additional dataset. Is it
> possible to read values from the Report table and display those values in a
> separate textbox? How to do this? Can I write a function in the code window
> and read from that? I guess I will find out.
> Any suggestions appreciated on a technique to read values (aggregated values
> say - from the dataset) via a function in the code window so that I can
> display the resulting value in a separate textbox.
> Thanks,
> Rich
As long as you are not trying to take an aggregate of an aggregate
[i.e., avg(sum(...))], you should be able to do it via something like
the following as a separate textbox expression, etc:
=Sum(Fields!SomeFieldName.Value, "DataSetNameUsedInTable")/Sum(Fields!
SomeOtherFieldName.Value, "DataSetNameUsedInTable")
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||Thank you for your reply. That should do the trick.
"EMartinez" wrote:
> On Apr 9, 4:54 pm, Rich <R...@.discussions.microsoft.com> wrote:
> > Hello,
> >
> > I need to display a percentage calculation from some values in a table
> > footer row, and I want to display that in a separate textbox not in the
> > Report table. I hope this can be done simply without having to create an
> > additional dataset and display the value from the additional dataset. Is it
> > possible to read values from the Report table and display those values in a
> > separate textbox? How to do this? Can I write a function in the code window
> > and read from that? I guess I will find out.
> >
> > Any suggestions appreciated on a technique to read values (aggregated values
> > say - from the dataset) via a function in the code window so that I can
> > display the resulting value in a separate textbox.
> >
> > Thanks,
> > Rich
>
> As long as you are not trying to take an aggregate of an aggregate
> [i.e., avg(sum(...))], you should be able to do it via something like
> the following as a separate textbox expression, etc:
> =Sum(Fields!SomeFieldName.Value, "DataSetNameUsedInTable")/Sum(Fields!
> SomeOtherFieldName.Value, "DataSetNameUsedInTable")
> Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>|||On Apr 10, 10:42 am, Rich <R...@.discussions.microsoft.com> wrote:
> Thank you for your reply. That should do the trick.
> "EMartinez" wrote:
> > On Apr 9, 4:54 pm, Rich <R...@.discussions.microsoft.com> wrote:
> > > Hello,
> > > I need to display a percentage calculation from some values in a table
> > > footer row, and I want to display that in a separate textbox not in the
> > > Report table. I hope this can be done simply without having to create an
> > > additional dataset and display the value from the additional dataset. Is it
> > > possible to read values from the Report table and display those values in a
> > > separate textbox? How to do this? Can I write a function in the code window
> > > and read from that? I guess I will find out.
> > > Any suggestions appreciated on a technique to read values (aggregated values
> > > say - from the dataset) via a function in the code window so that I can
> > > display the resulting value in a separate textbox.
> > > Thanks,
> > > Rich
> > As long as you are not trying to take an aggregate of an aggregate
> > [i.e., avg(sum(...))], you should be able to do it via something like
> > the following as a separate textbox expression, etc:
> > =Sum(Fields!SomeFieldName.Value, "DataSetNameUsedInTable")/Sum(Fields!
> > SomeOtherFieldName.Value, "DataSetNameUsedInTable")
> > Hope this helps.
> > Regards,
> > Enrique Martinez
> > Sr. Software Consultant
You're welcome. let me know if you need further assistance.
Regards,
Enrique Martinez
Sr. Software Consultant|||Your suggestion did do the trick! Thanks again
"EMartinez" wrote:
> On Apr 9, 4:54 pm, Rich <R...@.discussions.microsoft.com> wrote:
> > Hello,
> >
> > I need to display a percentage calculation from some values in a table
> > footer row, and I want to display that in a separate textbox not in the
> > Report table. I hope this can be done simply without having to create an
> > additional dataset and display the value from the additional dataset. Is it
> > possible to read values from the Report table and display those values in a
> > separate textbox? How to do this? Can I write a function in the code window
> > and read from that? I guess I will find out.
> >
> > Any suggestions appreciated on a technique to read values (aggregated values
> > say - from the dataset) via a function in the code window so that I can
> > display the resulting value in a separate textbox.
> >
> > Thanks,
> > Rich
>
> As long as you are not trying to take an aggregate of an aggregate
> [i.e., avg(sum(...))], you should be able to do it via something like
> the following as a separate textbox expression, etc:
> =Sum(Fields!SomeFieldName.Value, "DataSetNameUsedInTable")/Sum(Fields!
> SomeOtherFieldName.Value, "DataSetNameUsedInTable")
> Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>|||Hello again,
I am now trying to read a date value from a dataset into a textbox, but I
just can't figure out the syntax. Using Aggregate functions won't work since
not numeric. Any suggestions appreciated.
Thanks,
Rich
"EMartinez" wrote:
> On Apr 10, 10:42 am, Rich <R...@.discussions.microsoft.com> wrote:
> > Thank you for your reply. That should do the trick.
> >
> > "EMartinez" wrote:
> > > On Apr 9, 4:54 pm, Rich <R...@.discussions.microsoft.com> wrote:
> > > > Hello,
> >
> > > > I need to display a percentage calculation from some values in a table
> > > > footer row, and I want to display that in a separate textbox not in the
> > > > Report table. I hope this can be done simply without having to create an
> > > > additional dataset and display the value from the additional dataset. Is it
> > > > possible to read values from the Report table and display those values in a
> > > > separate textbox? How to do this? Can I write a function in the code window
> > > > and read from that? I guess I will find out.
> >
> > > > Any suggestions appreciated on a technique to read values (aggregated values
> > > > say - from the dataset) via a function in the code window so that I can
> > > > display the resulting value in a separate textbox.
> >
> > > > Thanks,
> > > > Rich
> >
> > > As long as you are not trying to take an aggregate of an aggregate
> > > [i.e., avg(sum(...))], you should be able to do it via something like
> > > the following as a separate textbox expression, etc:
> > > =Sum(Fields!SomeFieldName.Value, "DataSetNameUsedInTable")/Sum(Fields!
> > > SomeOtherFieldName.Value, "DataSetNameUsedInTable")
> > > Hope this helps.
> >
> > > Regards,
> >
> > > Enrique Martinez
> > > Sr. Software Consultant
>
> You're welcome. let me know if you need further assistance.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>|||I tried using the Max aggregate functions which appears to do the trick. But
while I am at it, I tried passing in a Date parameter to a code function like
this:
public Function AddToDate(d1 As DateTime) datetime
return DateAdd(yy, -1, d1)
End Function
RS complained that yy was not declared. Is there a way to do this using the
code window?
Thanks,
Rich
"EMartinez" wrote:
> On Apr 10, 10:42 am, Rich <R...@.discussions.microsoft.com> wrote:
> > Thank you for your reply. That should do the trick.
> >
> > "EMartinez" wrote:
> > > On Apr 9, 4:54 pm, Rich <R...@.discussions.microsoft.com> wrote:
> > > > Hello,
> >
> > > > I need to display a percentage calculation from some values in a table
> > > > footer row, and I want to display that in a separate textbox not in the
> > > > Report table. I hope this can be done simply without having to create an
> > > > additional dataset and display the value from the additional dataset. Is it
> > > > possible to read values from the Report table and display those values in a
> > > > separate textbox? How to do this? Can I write a function in the code window
> > > > and read from that? I guess I will find out.
> >
> > > > Any suggestions appreciated on a technique to read values (aggregated values
> > > > say - from the dataset) via a function in the code window so that I can
> > > > display the resulting value in a separate textbox.
> >
> > > > Thanks,
> > > > Rich
> >
> > > As long as you are not trying to take an aggregate of an aggregate
> > > [i.e., avg(sum(...))], you should be able to do it via something like
> > > the following as a separate textbox expression, etc:
> > > =Sum(Fields!SomeFieldName.Value, "DataSetNameUsedInTable")/Sum(Fields!
> > > SomeOtherFieldName.Value, "DataSetNameUsedInTable")
> > > Hope this helps.
> >
> > > Regards,
> >
> > > Enrique Martinez
> > > Sr. Software Consultant
>
> You're welcome. let me know if you need further assistance.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>|||On Apr 10, 3:58 pm, Rich <R...@.discussions.microsoft.com> wrote:
> I tried using the Max aggregate functions which appears to do the trick. But
> while I am at it, I tried passing in a Date parameter to a code function like
> this:
> public Function AddToDate(d1 As DateTime) datetime
> return DateAdd(yy, -1, d1)
> End Function
> RS complained that yy was not declared. Is there a way to do this using the
> code window?
> Thanks,
> Rich
> "EMartinez" wrote:
> > On Apr 10, 10:42 am, Rich <R...@.discussions.microsoft.com> wrote:
> > > Thank you for your reply. That should do the trick.
> > > "EMartinez" wrote:
> > > > On Apr 9, 4:54 pm, Rich <R...@.discussions.microsoft.com> wrote:
> > > > > Hello,
> > > > > I need to display a percentage calculation from some values in a table
> > > > > footer row, and I want to display that in a separate textbox not in the
> > > > > Report table. I hope this can be done simply without having to create an
> > > > > additional dataset and display the value from the additional dataset. Is it
> > > > > possible to read values from the Report table and display those values in a
> > > > > separate textbox? How to do this? Can I write a function in the code window
> > > > > and read from that? I guess I will find out.
> > > > > Any suggestions appreciated on a technique to read values (aggregated values
> > > > > say - from the dataset) via a function in the code window so that I can
> > > > > display the resulting value in a separate textbox.
> > > > > Thanks,
> > > > > Rich
> > > > As long as you are not trying to take an aggregate of an aggregate
> > > > [i.e., avg(sum(...))], you should be able to do it via something like
> > > > the following as a separate textbox expression, etc:
> > > > =Sum(Fields!SomeFieldName.Value, "DataSetNameUsedInTable")/Sum(Fields!
> > > > SomeOtherFieldName.Value, "DataSetNameUsedInTable")
> > > > Hope this helps.
> > > > Regards,
> > > > Enrique Martinez
> > > > Sr. Software Consultant
> > You're welcome. let me know if you need further assistance.
> > Regards,
> > Enrique Martinez
> > Sr. Software Consultant
It took me a while to figure this one out.
Ok. Something like this should work as an expression:
=Dateadd("y", -1, Max(Fields!DateTimeFieldName.Value, "DataSetName"))
-or-
=Dateadd("y", -1, Parameters!DateTimeParameterName.Value)
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant