New To SSRS - Pass Query Paramater At Runtime

Jun 21, 2007

Hi all,

Im new to SSRS, basically I have created and deployed a report to my reporting server.

Now I have a query parameter on my report. From my application, I can access the report manager, and here it asks me for my variable. I'm not sure if my question is a vb.net one, but I was wondering if anyone knew how I could pass my query paramater to SSRS at runtime. Basically it would be easier for my users if they could just see the report they are interested in, rather than having to type the variable in to be able to see the report.

Thanks for your time.
Pace

"Impossible is Nothing"

View 1 Replies


ADVERTISEMENT

New To SSRS - Pass Query Paramater At Runtime

Jun 21, 2007

Hi all,

Im new to SSRS, basically I have created and deployed a report to my reporting server.

Now I have a query parameter on my report. From my application, I can access the report manager, and here it asks me for my variable. I'm not sure if my question is a vb.net one, but I was wondering if anyone knew how I could pass my query paramater to SSRS at runtime. Basically it would be easier for my users if they could just see the report they are interested in, rather than having to type the variable in to be able to see the report.

Thanks for your time.
Barry Andrew

View 3 Replies View Related

How Do I Pass A Paramater?

Oct 19, 2006

Hey everyone I'm having trouble finding a way to pass a particular paramater, my main goal of this is to create a custom paging and sorting control for the DataList, but we wont worry about all the un-nessesarry code, here is what I am dealing with... Sub Page_Load()

Dim Conn As SqlConnection
Dim Query As String
Dim SqlComm As SqlCommand
Dim myDataReader As SqlDataReader

' Define connection object
Conn = New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)

' Define query to retrieve main category values
Query = "SELECT [productMainCategory] FROM [User_Products] WHERE [productMainCategory] = @productMainCategory"
' Define command object
SqlComm = New SqlCommand(Query, Conn)

' Open connection to database
Conn.Open()

' Create DataReader
myDataReader = SqlComm.ExecuteReader()

' Iterate through records and add to array list
While myDataReader.Read()
IDList.Add(myDataReader("productMainCategory"))
End While

' Close DataReader and connection objects
myDataReader.Close()
myDataReader = Nothing
Conn.Close()
Conn = Nothing

' If page has not been posted back, retrieve first page of records
If Not Page.IsPostBack Then
Paging()
End If

End Sub
The Entire Point to this bit of code is to open a connection to the database find the category productsMainCategory, count all the fields with the Name 3D Art --> and save that number into an Array List where I will be using it later on in my code......The big old problem here is that it counts every single field in the productsMainCategory, Columb.........I need to figure out how to pass it a parameter so that it only counts my 3D Art --> fields, I have tried using this bit of code but nothing             SqlComm.Parameters("@productMainCategory").Value = "3D Art -->"Does anyone have any ideas of how I might go about donig this?Thank You..

View 4 Replies View Related

How To Pass Table Name As Paramater In Stored Procedure

Feb 5, 2008

I am using SQL2005 and would like to know if it is possible to pass a table name as an input parameter in a stored procedure?? I am struggling to get it to work.

For example:

CREATE PROCEDURE dbo.StartBlock

@TableName varchar(30),

@minX float OUTPUT,



AS



BEGIN

SET NOCOUNT ON;





SET @minX = (SELECT min(X) as mX

FROM @TableName);



END

GO

The above does not work and give the following error

Must declare the table variable "@TableName"

Thanks
Christie

View 5 Replies View Related

Reporting Services :: Pass A Parameter To LDAP Query In SSRS

Aug 20, 2015

Is it possible to use a parameter in a ldap query using the ADsDSOObject provider?  I keep getting an error "The ICommandWithParameters interface is not supported by the "ADSDSOObject" provider".  Command parameters are unsupported with the current provider.

I don't have a linked server on my DB server to Active Directory so I'm just querying in the SSRS report design.  Here is my query for my dataset.  If I hard code an example it works.  Just doesn't work when I pass a parameter. I've tried making it an expression (= sign), Tried several syntax's, Tried everything I can think of.  Is this possible? or do I just need to push for a linked server?

="SELECT sAMAccountName, displayName, distinguishedName " +
"FROM 'LDAP://DC=xxxx,DC=xx,DC=xx,DC=xx,DC=xx,DC=xx' " +
"WHERE objectCategory = 'Person' " +
"AND objectClass = 'user' " +
"AND memberOf = '" + @GlobalGroup + "'"

View 3 Replies View Related

Passing In Query Paramater Values Through WebUserControls

Jun 7, 2007

Hi, I don't want to pass in parameter values in the url to get a certain record from my database (for a better search engine result) so instead i'm using webuser controls (this is a must) with Public Values that should be read by the SqlDataSource. So in the page that contains the usercontrol there is something like:UserControl.Value = "myvalue"Now I want the SqlDataSource in the usercontrol to read this value and pass it into a query (in the parameter of the WHERE statement, eg.: @recordID = myvalue).Thanks in advance! 

View 1 Replies View Related

Please Help. How To Set A Parameter In SSRS In Runtime? Parameters!myParam.Value Property Is Read-only

Mar 8, 2007

 
You can set the default value of a reporting services parameter by any expression.
 
But with code I'm NOT allowed to do:
Parameters!myParam.Value = CDate("01.01.2007")
 
This is cause Value property is read-only.
So the question would be:
Are there any way I set a parameter value in runtime ?
 
Hope anyone can help...
 

View 3 Replies View Related

Reporting Services :: Start And End Date Parameters Report In SSRS 2008 Is Not Running On Runtime?

Aug 27, 2015

I made one report in SSRS 2008 in which getting data from one SharePoint List.

three parameters in report :

Country
StartDate
EndDate

I am using query which I created with CAML.

query is running well and data is coming correctly if I run this on Query designer.and date format must be YYYY-MM-DD.but when I try to run through on run time then the date control is showing format dd/mm/yyyy.

I change the regional settings of windows and SharePoint site to English(United States). and when I select date control it is also putting date in format like "YYYY-MM-DD'. and in that format report is working well in Query designer view.But on run time still it is not working.

View 3 Replies View Related

How To Pass Multiple Parameters In SSRS

Apr 25, 2008


Hi,

I am working on SSRS. I need to open a new report from one report when user clicks on some particular summerized count link.

Its a sort of drilled down report. I am not getting how to pass the respected Ids (more than one) to the next report when user clicks on the link in the 1st report. These ids I want to use as a parameter (multiple) in the 2nd report to dump the rows from the database.

Please help.

Regards,
Sachin

View 4 Replies View Related

SSRS: How To Pass Different Parameters Automatically To A Report

Nov 15, 2006

Hello all,

I have a project where I need to automatically pass 2 sets of parameters to a SSRS report and generate PDF files. I have set the defaults for the parameters based on one set of parameters and created a subscription to automatically generate PDF copy. However, I am not sure how to generate the report automatically using the other set of parameters. Also, I don't want to create two report files to accomplish this.

Can you please help?

Thanks in advance,
Saurav

View 1 Replies View Related

How To Pass Multiple Parameters Across Reports In SSRS

Apr 25, 2008



Hi,



I am working on SSRS. I need to open a new report from one report when user clicks on some

particular summarized count link.


It is a sort of drilled down report. I am not getting how to pass the respective Ids (more

than one) to the next report when user clicks on the summarized link in the 1st report.

These ids I want to use as a parameter (multiple) in the 2nd report to dump the rows from

the database.

View 3 Replies View Related

Sub: How To Pass Multiple Parameters Across Reports In SSRS

Apr 25, 2008

Hi,


I am working on SSRS. I need to open a new report from one report when user clicks on some

particular summarized count link.



It is a sort of drilled down report. I am not getting how to pass the respective Ids (more

than one) to the next report when user clicks on the summarized link in the 1st report.

These ids I want to use as a parameter (multiple) in the 2nd report to dump the rows from

the database.

View 1 Replies View Related

How To Pass Unnamed Parameter In SSRS 2005

Dec 4, 2007

hi all
m newbie for SSRS 2005 . when i ran the folowing query it gives an error like "An error occurred while executing the query.Parser: The syntax for '.' is incorrect".

WITH
SET [FilteredAccountSet] AS 'order(Parameter!Account.Value,[Measures].[_MeasureBillingCode],ASC)'

SELECT {
[FilteredAccountSet]
} ON COLUMNS


FROM [Profitability]


may i know the reson?????

View 1 Replies View Related

How Do I Pass A Parameter From A SSRS Report To The Sql Stmt In A SSIS Package

Aug 24, 2007

How do I pass a parameter from a SSRS report to the sql stmt in a SSIS package?
Mainly need to know the correct syntax of the connection string to use for the datasource in the SSRS report. Every time I add the /SET part of the string the connection breaks.
The connection string i've been using is:
/file "C:\PackageName.dtsx /Set Package.Variables[StartDate];"&Parameters!StartDate.Value

View 26 Replies View Related

Pass A Parameter From A SSRS Report To The Sql Stmt In A SSIS Package

Aug 24, 2007

How do I pass a parameter from a SSRS report to the sql stmt in a SSIS package?
Mainly need to know the correct syntax of the connection string to use for the datasource in the SSRS report. Every time I add the /SET part of the string the connection breaks.
The connection string i've been using is:
/file "C:\PackageName.dtsx /Set Package.Variables[StartDate];"&Parameters!StartDate.Value

View 3 Replies View Related

Analysis :: How To Pass Apply SSRS Parameters On Multiple Dimension Attributes

Oct 13, 2015

How @StartDate and @EndDate parameters must added to the MDX query for usage in SSRS data set. strtomember can be used like

SELECT (
strtomember(@StartDate) : strtomember(@EndDate)
) ON COLUMNS FROM [Cube]

How can i specify that sub-select must work on the [Fact A] and [Fact B] rundate? strtomember(@StartDate) does not specify on which attribute this sub select is going to work. Any pointers ?

FROM
(
SELECT
(
[Fact B].[Rundate].&[2015-01-02T00:00:00] : [Fact B].[Rundate].&[2015-01-15T00:00:00]
) ON COLUMNS FROM
(
SELECT
( [Fact A].[Rundate].&[2015-01-02T00:00:00] : [Fact B].[Rundate].&[2015-01-15T00:00:00] ) ON COLUMNS FROM [Cube]
)
)

View 2 Replies View Related

Reporting Services :: Unable To Pass Parameters Dynamically In SSRS 2012

Oct 1, 2015

I am creating simple report in ssrs and pass one parameter only. It will work perfectly (here user enter the parameter value). but i need that i should select the value in drop down box. i had tried many time and did different ways but I am unable to do it.

First i gave the parameter in my sql query in Data set (like WHERE COUNTRY = @COUNTRY) and i checked the Parameters tab in the data set. Here by default comes the Parameter Name: COUNTRY and Parameter value: [@COUNTRY].

Next i select COUNTRY Parameter in the Report Data Pane. and go to properties Here in General Tab: Name COUNTRY Prompt: COUNTRY, Select Get values from query in available values Tab (and also i tried with Select Get values from query in Default Value Tab) and Select Data set: Data Set1, Value field: COUNTRY and Label Field COUNTRY. And Click Ok

And tried to preview the report, it throwing below error

"An error Occured during local report processing.  The definition of the report is invalid. The Report Parameter 'COUNTRY' has a DefaultValue or a ValidValue that depends on the report parameter "COUNTRY". Forward dependencies are not valid.

How can I achieve dropdown list.What i missed? Even i unable to do it Multi valued parameters and Cascading parameters.

Actually i am working on SQL Express 2012 version.

View 5 Replies View Related

Using The SQL Query At Runtime..

Mar 28, 2007

Hi,

Currently im using SQL queries in combination with ASP.NET..

I have currently only one table('Requests'), which has all the user info of name,id,studyrequested etc.. A person can request for any number of studies.

Now the prob is that from now on whenever a user requests for a new study not only should his details be stored in the Request table but also in a new Users table. In the Users table that particular users details must only be loaded once.. i.e. if the same user enrolls for another study his details should only be updated in the requests table and not in the Users table, since his details have already been loaded once in the Users Table..

While this works fine for new users, but what bout the old users already stored in the Requests table before the Users table existed.

Is there any way i could run a sql script only once at runtime, so that all the old legacy users are loaded once in to the Users Table.



Thanks,
Nitin

View 1 Replies View Related

Query Error During Runtime

Jul 23, 2005

I get Invalid object name 'bstr'. when I try to run this querySelect distinct c0.oid, c1.Value, c2.Value, c3.ValueFrom(SELECT oid FROM dbo.COREAttributeWHERE CLSID IN ('{1449DB2B-DB97-11D6-A551-00B0D021E10A}','{1449DB2D-DB97-11D6-A551-00B0D021E10A}','{1449DB2F-DB97-11D6-A551-00B0D021E10A}','{1449DB31-DB97-11D6-A551-00B0D021E10A}','{1449DB33-DB97-11D6-A551-00B0D021E10A}','{1449DB35-DB97-11D6-A551-00B0D021E10A}','{1449DB37-DB97-11D6-A551-00B0D021E10A}','{1449DB39-DB97-11D6-A551-00B0D021E10A}','{1449DB3B-DB97-11D6-A551-00B0D021E10A}','{1449DB3D-DB97-11D6-A551-00B0D021E10A}','{1449DB3F-DB97-11D6-A551-00B0D021E10A}','{1449DB43-DB97-11D6-A551-00B0D021E10A}','{1449DB45-DB97-11D6-A551-00B0D021E10A}','{1449DB47-DB97-11D6-A551-00B0D021E10A}','{1449DB49-DB97-11D6-A551-00B0D021E10A}','{1449DB4B-DB97-11D6-A551-00B0D021E10A}','{1449DB4D-DB97-11D6-A551-00B0D021E10A}','{1449DB51-DB97-11D6-A551-00B0D021E10A}','{DAA598D9-E7B5-4155-ABB7-0C2C24466740}','{6921DAC3-5F91-4188-95B9-0FCE04D3A04D}','{128F17D4-2014-480A-96C6-370599F32F67}','{9F3A64C9-28F3-440B-B694-3E341471ED8E}','{2E3AB438-7652-4656-9A18-4F9C1DC27E8C}','{B69E74A7-0E48-4BA2-B4B7-5D9FFEDC2D97}','{2BB836D3-2DC1-4899-9406-6A495ED395C3}','{9CFFDC3A-5DF5-4AD8-B067-6EF5A9736681}','{E18E470B-B297-43D2-B9CD-71AF65654970}','{9BDCDA97-1171-409D-B3AB-71DA08B1E6D3}','{0E91AC62-7929-4B42-B771-7A6399A9E3B0}','{C8BAE335-CCB7-4F1D-8E9D-85C301188BE2}','{97E6E186-8F32-42E6-B81C-8E2E0D7C5ABA}','{BE5B6233-D4E7-4EF6-B5FC-91EA52128723}','{4ECDAAE1-828A-4C43-8A66-A7AB6966F368}','{19082B90-EF02-45CC-B037-AFD0CF91D69E}','{6F76CEF7-EBC0-48C6-8B78-C5330324C019}','{18492042-B22A-4370-BFA3-D0481800BBC7}','{A71343AD-CC09-4033-A224-D2D8C300904A}','{EC10BD0A-FDE3-4484-BEA6-D5A2E456256C}','{F7F8A4E1-651A-4A48-B55A-E8DA59D401B2}','{A923226F-B920-4CFA-9B0D-F422D1C36902}','{A95ACA6A-16AC-47E4-A9A6-F530D50A475A}','{C31DB61A-5221-42CF-9A73-FE76D5158647}')) AS c0 ,(select oid, dispid, valueFROM dbo.COREBSTRAttributeWHERE iid = '{1449DB20-DB97-11D6-A551-00B0D021E10A}') As bstrLEFT JOIN bstr AS c1ON (c0.oid = c1.oid)AND c1.dispid = 28LEFT JOIN bstr AS c2ON (c0.oid = c2.oid)AND c2.dispid = 112LEFT JOIN bstr AS c3ON (c0.oid = c3.oid)AND c3.dispid = 192thanksSunit

View 1 Replies View Related

Programtically Capture Query Runtime

Jul 20, 2005

What are some sound solutions to capture the query runtime via ascript/proc? The info returned from Statistics time is hard to process.The goal is to run a statement(s) and capture and track the executiontime to check on the availability of SQL Server. The data can beanalyzed to determine when perf is high and low. But the main reason isto check db availability.Thanks,Mike--Posted via http://dbforums.com

View 3 Replies View Related

Help With Modifying A Data Source's Query At Runtime

Sep 13, 2007

Please help figure out what is wrong with my code. The script is supposed to load a package (from file). The loaded package already has everything set up to run a query against a local server and output the results to an Excel file. The reason for the outer script is because I need to change the query based on a global variable. When the query changes, though, I think the existing dataflow Path is no longer valid, so I should remove it and re-create another one with the new input mappings. Here is my code, which runs and throws an exception at the AcquireConnections call.

The error is

Error: 0x2 at Script Task: The script threw an exception: Exception from HRESULT: 0xC020801B

I pieced together this code from the examples in the online books, but I am not sure what to do.



' Microsoft SQL Server Integration Services Script Task

' Write scripts using Microsoft Visual Basic

' The ScriptMain class is the entry point of the Script Task.

Imports System

Imports System.Data

Imports System.Math

Imports Microsoft.SqlServer.Dts.Runtime

Imports Microsoft.SqlServer.Dts.Pipeline

Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper





Public Class ScriptMain


Public Sub Main()

'

Dim app As Microsoft.SqlServer.Dts.Runtime.Application = New Application()

Dim package As Microsoft.SqlServer.Dts.Runtime.Package = _

app.LoadPackage("c:systimeExcelOutExcelOutExcelOutDo.dtsx", Nothing)


Dim pkgVars As Variables = package.Variables

Dim gsVar As Variable = pkgVars("User::gsExcelFile")

Dim currVars As Variables = Dts.Variables

Console.WriteLine(Dts.Variables("User::gsExcelFile").Value)

gsVar.Value = Dts.Variables("User::gsExcelFile").Value

pkgVars("User::gsQuery").Value = Dts.Variables("User::gsQuery").Value

pkgVars("User::gsCreateTable").Value = Dts.Variables("User::gsCreateTable").Value


Dim e As Executable = package.Executables("ExcelOutTask")

Dim thMainPipe As Microsoft.SqlServer.Dts.Runtime.TaskHost = _

CType(e, Microsoft.SqlServer.Dts.Runtime.TaskHost)

Dim dataFlowTask As MainPipe = CType(thMainPipe.InnerObject, MainPipe)


' Get the source component.

Dim SourceComponent As IDTSComponentMetaData90 = _

dataFlowTask.ComponentMetaDataCollection("Local Source")

Dim srcDesignTime As CManagedComponentWrapper = SourceComponent.Instantiate()

srcDesignTime.ProvideComponentProperties()


' Reinitialize the metadata.

srcDesignTime.AcquireConnections(vbNull)

srcDesignTime.ReinitializeMetaData()

srcDesignTime.ReleaseConnections()


' Get the destination component.

Dim destination As IDTSComponentMetaData90 = _

dataFlowTask.ComponentMetaDataCollection("Excel Destination")

Dim destDesignTime As CManagedComponentWrapper = destination.Instantiate()

destDesignTime.ProvideComponentProperties()



' Create the path.

dataFlowTask.PathCollection.RemoveAll()

Dim path As IDTSPath90 = dataFlowTask.PathCollection.New()

path.AttachPathAndPropagateNotifications(SourceComponent.OutputCollection(0), _

destination.InputCollection(0))


'Console.WriteLine(dataFlowTask.PathCollection.Count)

Dim ret As DTSExecResult

ret = package.Execute()

Console.WriteLine(ret.ToString)

Dts.TaskResult = Dts.Results.Success

End Sub

End Class


View 3 Replies View Related

Unknown Datetime Error In Query (Overflow At Runtime)

Aug 2, 2005

Hi all,

I have the following query...

SELECT    Count(*)
FROM        Incidents I
WHERE (Priority = 1)
AND (Time_First_Unit_On_Scene IS NOT NULL)
AND (DateDiff(s, Time_ClockStart, Time_First_Unit_On_Scene) <= 480) 
AND (Response_Date BETWEEN '1-Apr-2004')
AND ('31-Mar-2005 23:59:59')
AND (I.Disposition_ID <> 9 )

...and I get the following error message...

 System.Data.OleDb.OleDbException: Difference of two datetime columns caused overflow at runtime.

... any one know what it could be?

Thanks

Tryst

View 1 Replies View Related

Getting Count From Table In Linked Server Using Runtime Query

Mar 21, 2008

Hi Friends,
I want to have solution for one of the problem.
The requirement is like this :
I want to write stored procedure or function which will take parameter as SQL Server name, DB name, UserName and passwod.
This Stored proc will connect to Remote server using these parameters and will get the count of the rows in one of the table.
I created the connection using the linked server

EXEC sp_addlinkedserver @SerevrName,N'SQL Server'



EXEC sp_addlinkedsrvlogin @SerevrName, False, Null, @ServerUserName,@SerevrPws

Now I am trying to get count using following query :
set @SQLQuery = 'SELECT count(*) FROM [' + @SerevrName + '].' + @SrcDataBaseName +'.dbo.<<TableName>>'

But the question is that the execution goes this way :

exec(@SQLQuery)


Now how to assign this count value to some variable so that I can use it later ...?

Going forword I want to use cursor and get the rows in these table using cursor ...?
How can I assign values returned from any runtime query to temporary variable or table ...?


I tried another approach also:
I put remote connection and query execution in inner stored proc called usp_GetTableRowCount
set @SQLQuery = 'SELECT count(*) FROM [' + @SerevrName + '].' + @SrcDataBaseName +'.dbo.<<TableName>>'

exec(@SQLQuery)

and in outer stored proc : referenced the inner stored proc like this

exec @AFSDataRowCount = dbo.usp_GetTableRowCount <<Server Name>>,<<User Name>>, <<Password>>, <<DBName>>
The execution of dbo.usp_GetTableRowCount <<Server Name>>,<<User Name>>, <<Password>>, <<DBName>> gives me exact no of rows
but when I see value of AFSDataRowCount, I get 0.

Kindly help me out whereever I am making mistake or else pls tell me any other approach to follow.
Thanks in advance.

View 6 Replies View Related

How To Configure A Dataflow Task Having A Runtime Source Table Name And A Runtime Destination Table Name

Apr 18, 2008

Hi,

I am having a Data flow task in For each loop which will gets 100 sourcetable names and 100 target table names...

am having a simpleData flow task which trasferes from OLEDBSource to OLEDBDestination.
I am repeating the Dataflow task which transfers from sourcetablename extracted from for loop to a destination table var.

The problem am gettting is for the first table it is able to transfer correcly because I did mapping for those tables at design time...but for the next coming sourcetable-desttable (which r having different no of cols,datatypes) its giving Validation failed...and...needs to refresh metadata....

is there any way to refresh the metadata of Data flow task (I set the property of OLEDBSource validate external meta to false then also same error is coming)

Thanks
Radhika

View 4 Replies View Related

How Can I Return Everything While Using A Paramater

Jun 26, 2007

I guess a pretty basic sql question here. I am using tableadapters. And some of the queries have multiple parameters. But often a parameter is at a default or null - wherein I'd like to be able to pass it in and have it not filter at all - ie., return everything.
Simple example:
Select * from ReportsWhere ReportID = @ReportID 
 If I have a dropdownlist of reports where the values are ReportIDs - but the topmost unselected value is say "", then the results will be generated by
Select * from ReportsWhere ReportID = ''
Whis not what I want. What I would want is simply
Select * from Reports
or
Select * from ReportsWhere ReportID = ReportID
So how can one setup say an ObjectDataSource or somehow handle this where I don't need to use dynamic sql to expand/contract my where clause?
Really need hlpe on this and hope I've made my question reasonably clear. Thanks.
 
 

View 3 Replies View Related

Using Output Paramater

Nov 5, 2007

Hi all
         In my application i have to upload a excel file.After that it will retrive tha data from database depending upon the data in excel sheet.So now the problem is that i am using a stored procedure for this and in that procedurei have taken output parameter to catch any type of error.For example suppose in my excel sheet i have 3 columns.let it Group Code,Employee No and Employee Code.So incase it will not find the employee number so using the output parameter i am throwing the error message.So here we are getting two return types.one is the selected data and another is the error message.So how to handle these two thing in asp.net.Usong a dataset i can only retrive the selected data.But how to get the errror message as well as the data.So please help me.

View 1 Replies View Related

Trigger And Paramater

May 24, 2004

is possible for a trigger to check a particular record by passing a parameter during an update event?

if yes, what is the syntax?

View 3 Replies View Related

Parce A Db Paramater / Value

Apr 20, 2007

I need to parce a criteria in the data base
I have a field/colum in my tbl1 call invoice_num
I am left joining to to site_id on tbl2.
how can i talk tbl1 invoice_num and parce it to add in numbers.

IE tbl1.invoice _num is AF3456 and in order to match it to tbl2.site_id I need to add a 0 so that it would be AF03456 or AF034560.

Hope i did not loose you on this question.

View 2 Replies View Related

Help Selecting A Value From SQL To Pass To Query

Mar 25, 2008

I am trying to do the following.  I am capturing the logged in username from Windows Authentication then stripping the domain name using the following codeProtected Sub SqlDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs) Handles SqlDataSource1.Selecting        Dim Bareusername        e.Command.Parameters("@strusername").Value = My.User.Name        Bareusername = My.User.Name.Replace("MyDomain", "")        e.Command.Parameters("@LoginName").Value = Bareusername    End Sub I use the derived value as the where clause in a select query Select * from Master Where AccountName = @LoginName.  This allows a user to only see their own information in DetailsView1.  This is working as desired. I have another column in the Master table named ID.  This ID is the key that I need to reference to allow users to see and edit data in other tables.  So I would like to be able to do something like Select ID from Master where AccountName = @LoginName and be able to pass this value to  a Select statement against another table(Awards) for a DetailsView2 on the same page. Alternatively the value that I am trying to query is in the first row of DetailsView1.  Is it possible to access the value in that field and pass it in the query for DetailsView2?  This would be simpler if possible.I am not sure how to go about this and would appreciate any guidance that you could provide.  I have found a lot on the web regarding this based on a selected value but not through the method that I am trying to use.  Thanks in advance,Ken  

View 4 Replies View Related

Pass Through Query With Parameter???

Dec 13, 2000

I have the following function that is run when a person
enters a value, "Cell", in an access form. I am trying to
execute the pass through query in SQL Server but i keep
getting the following message:

"The microsoft jet database engine cannot find the input
table or query 'CellDefs'. Make sure it exists and its name
is spelt correctly."


There is nothing wrong with the table name.
I cant understand what the problem is ?????

Can anyone tell me how to execute a query that passes
a parameter from access to Sql server.

Thanks,
Ruaidhri



Public Function GetData(Cell As String)
Dim dbsCurrent As Database
Dim qd1 As QueryDef
Dim SQL As String
Dim rs As Recordset
Dim qdf As QueryDef
Set dbsCurrent = CurrentDb

Set qd1 = dbsCurrent.CreateQueryDef("")
With qd1
.Connect = "ODBC;DSN=MISChief;SERVER=Janeway;UID=sa;PWD=;DATA BASE=MIS"
SQL = ""
SQL = SQL + "INSERT INTO TableX SELECT A.Name AS CellCode, C.FinderNumber"
SQL = SQL + "FROM (CellDefs AS A INNER JOIN Calls AS B ON "
SQL = SQL + "A.CellDef_id = B.CellDef_id) INNER JOIN Finders AS C ON "
SQL = SQL + "B.Finders_id = C.Finders_id "
SQL = SQL + "WHERE A.Name LIKE '" & Cell & "' "
SQL = SQL + "ORDER BY C.FinderNumber"
.ReturnsRecords = False
.ODBCTimeout = 2400

dbsCurrent.Execute (SQL)
End With
dbsCurrent.Close
End Function

View 1 Replies View Related

Can We Pass Some Info From Sql Query To Dos

Oct 3, 2004

suppose i get date from MSsql how do i pass that to dos command is there a way so i can maipulate date and pass on to dos command to run at certain time

View 14 Replies View Related

Pass Through Query From MS Access

Jan 2, 2008

I would like to call this stored procedure, but I am unable to passparameters to the @Start and @End.Is thier a way to pass parameters to a pass through query from MSAccess?SELECT COUNT(dbo.tblPersActionHistory.PersActionID) AS [Total Ct],[dbo].fn_FindStartPayPeriod(dbo.tblPersActionHistory.Pe rsActionID, 2)AS [Signed PP]FROM dbo.tblPersActionLog INNER JOINdbo.tblPersActionHistory ONdbo.tblPersActionLog.PersActionID =dbo.tblPersActionHistory.PersActionIDWHERE (dbo.tblPersActionLog.StatusID BETWEEN 4 AND 7) AND(dbo.tblPersActionLog.Rejected = 0) AND(dbo.tblPersActionLog.IsPayAction = 0) AND(dbo.tblPersActionHistory.ActionTypeID = 5) AND(dbo.fn_IsParACorrection(dbo.tblPersActionHistory. PersActionID) = 0)AND([dbo].fn_ParNotException(dbo.tblPersActionHistory.PersA ctionID) = 1)AND (dbo.tblPersActionHistory.ItemDTG >= @StartDate) AND(dbo.tblPersActionHistory.ItemDTG <= @EndDate)GROUP BY[dbo].fn_FindStartPayPeriod(dbo.tblPersActionHistory.Pe rsActionID, 2)

View 2 Replies View Related

Multiple Paramater Search

Sep 23, 2005

I have a search page, containing 3 drop down lists. Theses are used to match data in 3 seperate collumns of a table.I can get the search to work when all boxes are completed, but I need to be able to leave some blank.A similar question was asked in http://forums.asp.net/626941/ShowPost.aspxAnd a very good solution was give: http://www.sqlteam.com/item.asp?ItemID=2077But I don't seem to be able to get any of these examples working!If I use the SET @SQL method, I get an error message saying that my input parameter has not been declared, when it has.When I use the COALESCE method, there is no data returned.(I am passing the data drop down list data fin the search page through the query string to a results page).Does anyone know of any other examples, or sample coding??Thanks...

View 2 Replies View Related







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