A View Based On A Parameter

Jan 22, 2006

Hello.

After upsizing an access mdb backend to SQL Server 2005, some of the access frontend queries need rewriting.

One of my Access queries contains several joined tables (tables that used to live on users local c drive) and also references the value of a form control as its where criteria. When this is run against linked sql tables it is very slow.

So I thought I would use a view to represent the joined tables and link to that in Access, but views don't allow you to pass parameters. How do I create a view that I can link to in my access front end whose contents will vary based on a passed parameter from Access? I am OK at vba coding so I can call to this object in code if necessary. The recordsource needs to be updateable.

Any help would be appreciated!

Shirley

View 1 Replies


ADVERTISEMENT

Reporting Services :: Call Related View Based On Parameter Value

Jun 15, 2015

I am working on SSRS. Based on parameter value I needs to call the related view. Below are my current expression query. but it has some error.

=IIF(Parameters!RacServiceOfferingsOnly.Value=0, SELECT * FROM VW_FLIGHT_SHEET_SUMM_RAC_N WHERE "TransferDate" BETWEEN DECODE(:StartDate,NULL, "TransferDate",:StartDate) AND DECODE(:EndDate,NULL, "TransferDate",:EndDate) AND
(:TransferType IS NULL OR :TransferType = "Direction"),SELECT * FROM VW_FLIGHT_SHEET_SUMM_RAC_Y WHERE "TransferDate" BETWEEN DECODE(:StartDate,NULL, "TransferDate",:StartDate) AND DECODE(:EndDate,NULL, "TransferDate",:EndDate))

View 2 Replies View Related

OLAP Datasource: Second Parameter List To Be Filtered Based On The First Parameter

Apr 17, 2008

Does anyone know if this is possible right out of the box in SSRS 2005 against an OLAP data source?


I have several parameters. My second parameter is to be filtered based on the first parameter (kinda like cascading), but how do I do this against an OLAP data source? Lets say I have param1 and param2 in a dataset. I want Param2 to show the locations only based on what I select in Param1.
Same but a little different: I have Parameter1 and then my second parameter (Param2) is a boolean (True/False). I want to show Parameter 3/Paramater 4 based on selection of Param2 (So, if true, show Param3, if false, show Param 4) and remember we are doing this in a sequence.
Can you do this thru SSRS? Any help would be great.
Thanks for your time in advance.
Kent

View 2 Replies View Related

Is It Possible To Dynamically Populate A Parameter List With Values Based On Another Parameter Value?

Aug 11, 2005

Is it possible to fill a parameter list with values based on another parameter value?
Here's what I have so far (which hasn't worked)...
I'd like to generate a report listing information for a student.  The report viewer would first select a school from the first drop-down menu, and then the second drop-down menu would populate with the list of students at that school.
I have a dataset that calls a sp which returns a list of schools (SchoolID and SchoolName fields from the database table).
I have another dataset that calls a sp (with SchoolID as the parameter) which returns a list of students for that school.
Both datasets return the appropriate data when tested individually, but when I set up the Report Parameters and build the report, these errors come up...
The value expression for the query parameter '@SchoolID' refers to a non-existing report parameter 'SchoolID'.
The report parameter 'Student' has a DefaultValue or a ValidValue that depends on the report parameter "SchoolID".  Forward dependencies are not valid.
...Is it possible for the reoprt to generate a list of available parameter values based on the value selected for another parameter?
Any help you can give me would be great!!  Thank you

View 5 Replies View Related

Reporting Services :: Hide / Unhide A Parameter Based On Another Parameter?

Oct 18, 2015

I am using reporting services 2012, Can we make visibility of report parameter dynamic, ie can we make parameter visible or hide on certain condition or its visibility depends on other parameters Is this feature  available in any other updated version of ssrs? 

View 2 Replies View Related

Two Parameters Question? Second Parameter Should Get Data Based On First Parameter Selection.

Jan 8, 2007

I have two parameters both are related to each other.

second parameter should get filled based on the selection of the first one which is project.

the first paramater is project, once the project is selected it should bring the all the contracts related to that project.

Please is it possible...



Thank you very much for all the helpful info.

View 5 Replies View Related

SSRS Toggle Parameter Between Multi-Value And Single Value Based On Another Parameter

Feb 4, 2008



I would like to be able to adjust the multi-value property of a parameter based on the value of another parameter in my report. The controlling paramter would be binary with two options for Single or Multiple selection. I would like my parameter to default to multi-value, which I can do on the screen selection. I have tried to add an IIF statement to the XML code, with no success. Any ideas would be helpful.

Thanks

View 4 Replies View Related

Reporting Services :: Displaying Report Parameter Based On Another Parameter

Aug 10, 2015

I am using report builder 3.0.

I have a report parameter called para1 which is a drop-down list and what I want to do is display another report parameter based on the para1 selection.

So for example, para1 contains a, b, c choices.  if a user selects b, I would like para2 to display but if the user selects a or c, I don't want the para2 to display.

View 5 Replies View Related

In 2000 Is It Possible To List Second Parameter Based On The First Parameter Selection

Jan 11, 2007

Hi

In 2000 is it possible to list second parameter based on selection

in the first parameter list

Cheers

View 10 Replies View Related

Parameter: C, I, P, Or ALL...how To Select Based On Parameter?

Jul 27, 2006

Hi everyone,

I have this semi-complex query that is selecting items from numerous tables residing on 2 different databases. So far the query works perfectly. Here is the problem: The user is given the option of selecting items based on whether a course is Completed (C) Incomplete (I) Passed (P) Failed (F) or (ALL). I am not really sure how to do the select all, the others I can do depending on the value...

Any thoughts??

Query:


sql Code:






Original
- sql Code





ALTER PROCEDURE [dbo].[Sel_CourseActivityPerUser]
(
@status varchar(25),
@course varchar(100),
@datesmalldatetime
)
AS

SELECT
A1.uLastName,
A1.uFirstName,
A2.mName,
A3.tStatus,
A3.tScore,
A3.tStartDate,
A3.tCompleteDate,
A4.cName

FROM VSALCP.dbo.[User] as A1
INNER JOIN FSDLMS.dbo.Student as A5
ON A1.uID = A5.stID

INNER JOIN FSDLMS.dbo.Transcript as A3
ON A3.t_FK_stID = A5.stID

INNER JOIN VSALCP.dbo.Member as A2
ON A2.mID = A1.u_FK_mID

INNER JOIN FSDLMS.dbo.Course as A4
ON A4.cID = A3.t_FK_cID

Where @status = A3.tStatus ...






 ALTER PROCEDURE [dbo].[Sel_CourseActivityPerUser]    (        @status varchar(25),        @course varchar(100),        @date   smalldatetime    )AS   SELECT    A1.uLastName,    A1.uFirstName,     A2.mName,    A3.tStatus,    A3.tScore,    A3.tStartDate,    A3.tCompleteDate,    A4.cName     FROM VSALCP.dbo.[User] AS A1    INNER JOIN FSDLMS.dbo.Student AS A5    ON A1.uID = A5.stID     INNER JOIN FSDLMS.dbo.Transcript AS A3    ON A3.t_FK_stID = A5.stID     INNER JOIN VSALCP.dbo.Member AS A2    ON A2.mID = A1.u_FK_mID      INNER JOIN FSDLMS.dbo.Course AS A4    ON A4.cID = A3.t_FK_cID WHERE @status = A3.tStatus ...


"If status = ALL select * status"

Thanks for taking a look!

View 3 Replies View Related

Create A View Based On Variables?

Jul 28, 2004

Hi All,

I would like to create a view based on a variable (a date).

CREATE VIEW testView (@myDate)
AS

select * from testTable
WHERE testVar = @myDate

--
This is far from what the final view would look like, but if anyone knows if something similiar to this can be done, I would greatly appreciate it.

Thanks.

View 1 Replies View Related

View To Get Record Based On A Column Value

Jul 24, 2013

I have a view where the results would be like this.(userid,name,rolekey are my col names with data)

userid name rolekey
test1 tname rolekey1
test1 tname rolekey2
test1 tname rolekey3

is this possible to retireve data from view where i need only userid with rolekey1.? tried with a function but its taking more time? any options in doing it in the view itself?

View 5 Replies View Related

View Based On Table Modification

Aug 8, 2013

I have been inserted one row in to table called as Teachers..

vTeachers is the View ctreated on Teachers Table.

When i Inserted one row in to Table Teachers i didn't see that row in vTeachers View.

How can i get that newly inserted values in to my View?

View 4 Replies View Related

Update View Based On Two Tables

Mar 26, 2008

I have a view based on two tables. Now I want to update that view in such a manner that the columns of both the tables are going to update.
Can you suggest me what code I should write so that I can update that view.

View 1 Replies View Related

Creating Records Based SQL View

Oct 30, 2007

I have a spreadsheet that we download from one of our customers that contains Sales Order Release information. The spreadsheets contains 1-n releases per part #.

I have a SQL 2000 view that groups this information into a smaller table (after importing into SQL).

I need to take this view and create 1-n release records based on our production run qty and put it in a new table. I have a field in my view that contains the desired # of records to create.

Since I never used TSQL to loop through table/view, how do I do this. Following is what the output should look like:

From SQL view
---------------------------------------
Part #: 11124A1
Qty Due:175
Run Qty: 50
# Release to Generate: 4


Output to Table
----------------------

Part # QtyDue RunQty
----------------------------------------------------
11124A1 50 50
11124A1 50 50
11124A1 50 50
11124A1 25 50

Note QtyDue is the production run qty, with the last record containing the remaining QtyDue from view's Qty Due

View 4 Replies View Related

Creating A Report Model Based On A View

Aug 1, 2007

in my report model project, i'm able to successfully create and deploy a report model based on a data source view that is in turn based on a table object in my data store.

but if i try to create a report model that's based on a a data source view that is in turn based on a view in my data store, well then, the report model that gets created comes up blank - i.e. shows no objects.

What gives? Is it not possible to create a report based on a view? that can't be right!

View 6 Replies View Related

Parameter Based DTS Transformation

Oct 22, 2004

How can I implement this logic in my DTS package?

IF GlobalVariable1 = '10/21/2004' THEN
Do Transformation1 (parameter1)
ELSE
Do Transformation2 (parameter1,parameter2)
END IF

View 3 Replies View Related

Different Image Based On Parameter

Apr 23, 2008

I am creating a report that will act as statements for our companies, I am slightly stuck at the moment, I have two required parameters one is the company prefix and the other is the customer code.



I have a image at the top of the statement that I want to be dynamic i.e. when there is a company code of 1 I want one particular image and when there is a company code of 2 I want another.



Is this possible? If so are there any instructions on how one might set this up



Thanks

View 5 Replies View Related

How To Update Time Series Based On Another Table(or View)??

Feb 15, 2005

Hi all,
I have two tables (staging and Cdate) and neither objects has any constraints.
staging table has ID, date, A, B, and C fields and Cdate has id,date and day fields. I need to update/insert date from Vdate into staging where staging ID=' ' and date is null
Here is the code I wrote, however, it seemed the information was updated to one date only instead of time series - Cdate contains time series in column date.
Anyone can help to fix it? Thank you for the help!

update s
set s.date=c.date
FROM cdate c join staging s on(s.id=c.id)
Where s.date is null and id=2

View 3 Replies View Related

[SQL2000] Permissions To Use View Based On Tables From Many Databases

Feb 21, 2006

HiI have two databases: Customers and Operations. In Customers database I havemade a view based on a few tables from both Customers and Operations (leftjoin - customers without any operations). In the same database (Customers) Ihave created a stored procedure based on the view. Finally I'd like to giveto some users permission only to exec the stored procedure.Have I to add the users to Customers? If yes, please describe me how tolimit the users privileges only to execution the stored procedure (no rightsto open tables or view from Customers).Regards,GrzegorzPs. I had sent the post on microsoft.public.sqlserver.security, but I had noanswer.

View 5 Replies View Related

Dyamic View/function Based On Table Data (?)

Sep 21, 2006

Hey,First, sorry if this post appear twice, because, I can not find my postrecently send, trying to post it once again.I'm out of ideas, so, I thought, will search help here again :(I'm trying to prepare a view for ext. app. This is in normal cases veryeasy, but what if the view structure should be dynamic?!Here is my point (I will siplify the examples).I have a table:create table t_data (id bigint identity (1,1) not null,valvarchar(10) not null,data varchar(100) not nullconstraint [PK_t_data] primary key clustered(id) with fillfactor = 90 on [PRIMARY] )goinsert into t_data (val, data) values('1111111111','1234567890abcdefghijklmnoprstuvwxyz 1234567890abcdefghijklmnoprstuvwxyz67890abcdefghij klmnoprstuvwxyz')insert into t_data (val, data) values('2222222222','1234567890abcdefghijklmnoprstuvwxyz 1234567890abcdefghijklmnoprstuvwxyz12345abcdefghij klmnoprstuvwxyz')insert into t_data (val, data) values('3333333333','12345abcdefghijklmnoprstuvwxyz12345 67890abcdefghijklmnoprstuvwxyz1234567890abcdefghij klmnoprstuvwxyz')insert into t_data (val, data) values('4444444444','67890abcdefghijklmnoprstuvwxyz12345 67890abcdefg12345hijklmnoprstuvwxyz67890abcdefghij klmnoprstuvwxyz')insert into t_data (val, data) values('5555555555','1230abcdefghijklmnoprst12345uvwxyz1 234567890abcdefghijklmnoprstuvwxyz67890abcdefghijk lmnoprstuvwxyz')gocreate table t_dataVal (id bigint identity (1,1) not null,valvarchar(10) not null,fill varchar(4) not nullconstraint [PK_t_dataVal] primary key clustered(id) with fillfactor = 90 on [PRIMARY] )goinsert into t_dataVal (val, fill) values ('1111111111','AAAA')insert into t_dataVal (val, fill) values ('2222222222','KKKK')insert into t_dataVal (val, fill) values ('3333333333','DDDD')insert into t_dataVal (val, fill) values ('4444444444','ZZZZ')insert into t_dataVal (val, fill) values ('5555555555','CCCC')gocreate table t_conf (id bigint identity (1,1) not null,start int not null,length int not null,description varchar(20) not null,constraint [PK_t_conf] primary key clustered(id) with fillfactor = 90 on [PRIMARY] )goinsert into t_conf (start, length, description) values (1,10,'value_1')insert into t_conf (start, length, description) values (11,3,'value_2')insert into t_conf (start, length, description) values(55,15,'value_3')insert into t_conf (start, length, description) values (33,2,'value_4')insert into t_conf (start, length, description) values (88,1,'value_5')insert into t_conf (start, length, description) values (56,7,'value_6')goNow here is the issue:table t_conf contain data, which can be modified by user. The user isseting the appropriate values.Now, there should be a view, which returns:- as headers (collumn names) this what is defined in description columnof t_conf (for example: value_1, value_2 ... value_6)- as values, substrings of all data from t_data, cutted with start andlength values for appropriate decription from t_conf.- first two columns of view, should be column val and fill of t_dataValtableSo the effect should be like this:valfillvalue_1value_2value_3value_4value_5value61111111111AAAA1234567890abc....2222222222KKKK1234567890abc....3333333333DDDD12345abcdefgh....4444444444ZZZZ67890abcdefgh....5555555555CCCC1230abcdefghi....of course, for all other value_x should be the appropriate substringsshown.Sounds simple, hm?Well, I'm trying to do this, since yesterday evening, and can not :(In real life, the call of view/function might happend a lot.The table t_data might have around 4000 records, but the data string islonger (around 3000 characters).Application, might acess a udf, which returns table, and I was focusingin that.Was trying, to create local temp table in function, to insert values,using cursor over t_conf.Unfortunately, everything what I get, is just a vertical representationof the data, and I need it horizontal :(The other problem in function is, that I can not use exec() (wll known)so I can not even create a table,dynamicly, using as column names description value from table t_conf,and as size of field length from this table.Sorry, that the description is maybe not exactly for my problem, butthis is because I'm not even sure, which way to use :(any help will be appreciated!Thank You - Matik

View 1 Replies View Related

Transact SQL :: Way To Have Trigger Fire When Something Happens To Tables That View Is Based On?

Nov 4, 2015

I created a view that joins several tables together and added an instead of insert, update trigger on it. My trigger works when I do an update/insert directly to the view, but it doesn't seem to fire when an insert/update is made to any of the tables that the view is based on. Is there a way to have the trigger fire when something happens to the tables that the view is based on? The application that the database is using is something that was purchased so I don't have access to the code to change any SQL statements that it's using.

View 5 Replies View Related

Query Parameter Based On Columnna,e...

Jun 24, 2008

good day dudes! here's my 2nd questione for ye'all...

my databases:

workshift
- shiftid
- shiftname
- timestart
- timeend
- flexwindow
- status

employeeplottedsched
- employeeid
- month
- year
- day1shiftid
- day2shiftid
- day3shiftid
...
...
...
- day29shiftid
- day30shiftid
- day31shiftid

how can I query the plotted shift sched of employees for a particular day? like I would like to know what shift the employees were scheduled
from day1 to 15 of May 2008? the days that I would like to query would be dynamic so it can be day1 to 15 or day3 to day5 or just day20...

any of you guys nice enough to enlighten me?


U + U + D + D + L + R + L + R + Sel + Start...

View 9 Replies View Related

Delete Table Based On 2 Parameter

Jun 24, 2014

I am getting runtime error for the below simple execution of sp even I tried casting the @dt to varchar still getting the same error. I want to delete the table based on the 2 parameter ...

1. Table Name first parameter
2. InCondition is the column name which of type datetime

CREATE PROCEDURE dbo.[DeleteTable](@InTblName NVARCHAR(250),@InCondition NVARCHAR(250))
AS
BEGIN
DECLARE @DeleteSQL NVARCHAR(250)
DECLARE @Dt DATETIME
SET @Dt = GETDATE()
SELECT @DeleteSQL = N'DELETE FROM ' + @InTblName +' WHERE '+@InCondition+ '=''' + @Dt+ ''''
SELECT(@DeleteSQL)
EXECUTE sp_executesql @DeleteSQL
END

I have corrected the code now, I am not getting the output it is throwing error at run time.

EXEC [DeleteTable] 'TABLE_NAME','COLUMN_NAME'

Where column_name is of datatype datetime

Msg 241, Level 16, State 1, Procedure spDeleteTable, Line 8
Conversion failed when converting date and/or time from character string.

View 12 Replies View Related

Changing The MDX Query Based On A I/P Parameter. Is This Possible?

Jul 8, 2006

Hi



I am generating report with my datasource to an OLAP Cube. I have scenario that there are 2 dimension tables pointing to a single fact table. According to a user input, i have to use one dimension table and not the other and vice versa. I tried using IIF statement in the MDX query designer., but was facing errors.

First of all i want to know if this is possible and if yes, how?

Also , Is it possible to open a window form on clicking any report data

(Similar to assigning hyperlink, but i want to open a window form instead!!!)





regard



Sai

View 2 Replies View Related

Toggle Expression Based On Parameter

Apr 30, 2007

Hi, I have a matrix report containing a parameter.The count of groups may change based on the parameter's value.Also these groups are connected to each other with toggle property.
For example;
--If the parameter's value is "year", the report have three (year, month, day) groups.Day is connected to month and month is connected to year with toggle property.
--If the parameter's value is "month", the report have two (month, day) groups.Day is connected to month with toggle property.
--If the parameter's value is "day", the report have one (day) group.There will be no toggle property.

The question is:
I wrote expressions for this report and set the visibility properties of the groups, but when I select the "day" or "month" value for the parameter, no groups are shown.I think the reason is "being connected to each other with toggle property".

How can I solve this?

View 5 Replies View Related

How To Disable A Report Parameter Based On Another?

Oct 14, 2007

I have a report that has 2 report parameters. The first paramter is a string type that allows null. It is supposed to allow the user to enter a memberId or just select all members (if the NULL is checked). The second report parameter is a multi valued selection that contains a list of country codes populated from a query.
What I like to have is when the user decides to enter a memberid (uncheck the NULL) to have the country codes report parameters disabled.
Is there a way to do that?
Thanks,
Elie

View 2 Replies View Related

Displaying Different Reports Based On A Parameter

Sep 27, 2007

Hi,

I have bunch of reports that take same set of parameters. I am trying parametrize the report type so that depending on the report type selected, body should display that report when user hits "View report" button. How can I do this? Pardon me if there is an obvious solution as I am pretty new to the joys of MS Reporting Services.

Thanks a bunch.

View 1 Replies View Related

Monthly Based Report Parameter

Oct 24, 2007

Hi guys,

I would need to add a monthly based parameter to my reports. In my actual scenario i have 2 datetime parameters : "start date" - "end date", that denotes the time interval in days. Is there any standard way to customize these parameters to set an interval between months?
In other words, i would need 2 parameters like these : "start month" (eg. august 2005) - "end month" (eg. march 2006), with the report filtering data among this given interval of months.

Thanks in advance for any suggestion.
Claudio

View 2 Replies View Related

File Location Based On Parameter ?

Jul 31, 2006

Currently

File Connection Manager Editor with

Usage Type : Create File

and

File: eg C:DBALogSSISPackage1.log

The desired Goal:

Rather than hardcode the file directory for a log file

eg C:DBALogSSISPackage1.log

can the definition be parameterized.



For example \MachineNameDBALogSSISPackage1.log

where MachineName is the location where the package is phyiscally

located.











View 6 Replies View Related

Parameter View

Jul 20, 2005

Hi everybody,this view runs just fine but when I try to save it I have an error message:ODBC error: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect ofsyntax error. Where is the problem? I use questionmark because I needunnamed parameter veiw.select ProductID, NameOfProduct from dbo.Products where ProductID < ?Thank you in advance,Danilo Popoviæ, B. Sc.Trgostil d.d. - ICToplièka 1649240 Donja StubicaCroatia

View 3 Replies View Related

View With Parameter

Nov 12, 2007

Hi,
I create a view in SQL Server Enterprise Manager - View Design, something like this:
Select customer, name from scheme.custm Where customer=?
There's a SQL Syntax error message - "Parameters cannot be used in this query type."

When I run a SQL query in SQL Query Analyzer as:
Create VIEW view_customer As Select customer,name from scheme.custm Where customer=?
There's an error as:
"COUNT field incorrect or syntax error."

What's the problem?

Thank.
Yabing

View 1 Replies View Related

SQL Auto Send Email Based On Parameter

May 5, 2008

I would like some help conceptualizing how to acomplish this task. My client has requested the ASP.NET web/SQL Server application send an email to one of our locations based on whether that location complied (via the web app) to each week's report. Here's how the flow would go:
The location checks the webpage weekly and selects their compliance to each record on the report. (They could overlook one of the records and not make a selection.)  The SQL db would then query the compliance table and create a report of those locations with at least one "non-compliance."  Then the Db would send a reminder email to each location on that report. The Db tables have the email address info assigned to each location, so I can join that to the compliance log table.
Can this be done? I am using SQL Server Management Studio Express and Visual Web Developer (VB.net).
Thank you for your ideas,SMc

View 7 Replies View Related







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