Monday, March 26, 2012
how to insert identity values
i am small problem,
i am having two columns 1 is col1 which is a primary key and col2 any think .now i want to insert the data into second column at that time the first column must get the values in identity (like 1,2,3,4 etc)
with out using identity(sql server)/generated always(db2)
can any one knows please explain itDidn't I answer this one already?
http://weblogs.sqlteam.com/brettk/archive/2004/06/29/1687.aspx|||Didn't I answer this one already?
http://weblogs.sqlteam.com/brettk/archive/2004/06/29/1687.aspx
OMFG brett, are you kidding?
you seriously expect people to remember everything you wrote up to several years ago on a completely different site from this one?
i don't know, man, did you answer it already?
sheesh|||jagadish, look up the SET IDENTITY INSERT option in Books Online.
Wednesday, March 7, 2012
how to implement user function/query
In my database I have a table which is some kind of history log. The report is designed to group these entries by date. Showing the history data for the entries works fine, but for any history entry I need to show its previous entry, too (that means the table row with maximum date being smaller than the current selected). But what function/query do I have to implement?
Help would be highly appreciated.
Thank you,
gbruse
Select statement with between, and|||But how can I use the result of a select statement in a function? What I wanted to do is getting all dates and getting the latest which is below the current selected (of the group).
gbr|||send me ur code and table structure|||+------+-------+--+--+---+-------+
| Field | Type | Null | Key | Default | Extra |
+------+-------+--+--+---+-------+
| id | int(10) unsigned | | PRI | NULL | auto_increment |
| id_cust | int(10) unsigned | | | 0 | |
| add_data | varchar(20) | YES | | NULL | |
+------+-------+--+--+---+-------+
Imagine you have a table with the dates a user bought something. What I want to achive is showing all items groupes by dates and the date before the selected date.
The report shall look like:
date customer goods
old 06/02/05 Mr. Brown ...
now 06/03/05 Mr. Brown ...
-------------------
old 07/02/05 Mrs. Green ...
new 07/24/05 Mrs. Green ...
Thanks for your replay,
gbr.|||It would help if somebody could tell how to write a query (select xyz from tab where ...) and how to store the return value into a variable. Giving an example to familiarize with the crystal syntax would be enough for the beginning.
gbr|||Is there anyone who can tell how to store an entire column of a table in a variable?
When I use this function
local datetimevar array dates := {tab.date};
count(dates);
Only 1 is displayed though there are more than 1 columns in this table...
Friday, February 24, 2012
How to ignore a dimension in MDX?
SurveyID ( --> Survey Dimesion)
GroupID( --> Group Dimension)
StatusID ( --> Status Dimension ... e.g. Complete, InProgress, New)
GroupCount (the actual measure)
How would I create a calculated member that would return the "overall" count for a specific group in a survey (e.g. ignore Status dimension) regardless if the user is slicing the data by Status or not?
Thanks again - wgpubs
Try this ("ignoring" the status dimension - your exact naming may differ):
CREATE MEMBER CURRENTCUBE.MyCount AS
'([Status].[StatusID].[All StatusID],[Measures].[GroupCount])';
|||tried this ... but if I include the ResponseStatus dimension in my slicer it still filters on ResponseStatus.In my slicer I got survey, group and response status ... the kind of report I'm trying to generate in SSRS needs to looks something like this:
Survey Group Count OverallCount
... where Count should use the ResponseStatus dimension (so that users can filter out certain statuses and what not thru a RS parameter) while OverallCount should not.|||My suggestion should work, if I understand you correctly. Please post your exact MDX query.|||Yah I thought it would too ... but no go. here is the query:
CREATE MEMBER CURRENTCUBE.[MEASURES].[Overall Group Count]
AS ([Response Status].[Response Status].[All], [Measures].[Group Count]),
VISIBLE = 1 ;
Sunday, February 19, 2012
How to hide subtotals if only 1 row in group?
Hello,
I have established a group so that I can provide subtotals following the presentation of the group's detail rows. I'm finding that many of the groups have only one row and my subtotals just echo what was already presented on the detail line. The overall effect is confusing to the user and a real vertical space-waster.
Can someone give me a technique or expression for hiding subtotals when the group size is 1 but showing subtotals when the group size is >= 2? If I hide the group when the group size is 1 row then the one detail row is hidden as well, no?
Thanks!
BCB
You can give your visibility the expression to count rows in that group and then False if more than 1|||But I just want to hide the subtotal line. Won't your approach hide the one detail line that belongs to the group as well as the group footer that contains the redundant subtotals?
Thanks.
|||Gotcha, another technique would be to make the font white or transparent by using the sae kind of expression....in this case you can determine exactly which text blocks you want to use
only problem is spacing issues
|||I'm, essentially, trying to do the same thing.
In my case, my report is a list of employees that can be generated for either full timers, part timers, or both.
I've set up a group on the full/part time field FT_PT. There is no group header, just a group footer.
When I generate the report for both I get:
Department Header
Full-Time Detail
FT_PT Group Footer
Part-Time Detail
FT_PT Group Footer
Department Footer
This is perfect.
When I generate it for, say, just Full-Time, I get:
Department Header
Full-Time Detail
FT_PT Group Footer
Department Footer
I don't want to see the FT_PT group footer. What I want is:
Department Header
Full-Time Detail
Department Footer
Gotta be a way to do this without having a blank line where the Full-Time Group Footer would be, isn't there?
How to hide subtotals if only 1 row in group?
Hello,
I have established a group so that I can provide subtotals following the presentation of the group's detail rows. I'm finding that many of the groups have only one row and my subtotals just echo what was already presented on the detail line. The overall effect is confusing to the user and a real vertical space-waster.
Can someone give me a technique or expression for hiding subtotals when the group size is 1 but showing subtotals when the group size is >= 2? If I hide the group when the group size is 1 row then the one detail row is hidden as well, no?
Thanks!
BCB
You can give your visibility the expression to count rows in that group and then False if more than 1|||But I just want to hide the subtotal line. Won't your approach hide the one detail line that belongs to the group as well as the group footer that contains the redundant subtotals?
Thanks.
|||Gotcha, another technique would be to make the font white or transparent by using the sae kind of expression....in this case you can determine exactly which text blocks you want to use
only problem is spacing issues
|||I'm, essentially, trying to do the same thing.
In my case, my report is a list of employees that can be generated for either full timers, part timers, or both.
I've set up a group on the full/part time field FT_PT. There is no group header, just a group footer.
When I generate the report for both I get:
Department Header
Full-Time Detail
FT_PT Group Footer
Part-Time Detail
FT_PT Group Footer
Department Footer
This is perfect.
When I generate it for, say, just Full-Time, I get:
Department Header
Full-Time Detail
FT_PT Group Footer
Department Footer
I don't want to see the FT_PT group footer. What I want is:
Department Header
Full-Time Detail
Department Footer
Gotta be a way to do this without having a blank line where the Full-Time Group Footer would be, isn't there?