Parameters On The Left Side Of A Where Clause Predicate
Apr 7, 2008
Good afternoon,
I'm trying to use a parameterin a way that RS seems to think is unnatural, and I'm wondering about a work around...
Normally I can use parameters like so:
select *
from foo
where fooValue > @myParameter
What I'd like to do instead is use a constant on the right of the predicate, and a parameter to define the column to measure against, like so:
select *
from foo
where @myParameter > 10
Or
select *
from foo
where @myParameter is not null
Any assist with this is greatly appreciated...
Thanks,
Brian
View 1 Replies
ADVERTISEMENT
Jul 3, 2006
Hi,I have 2 tables: tblStatements and tblLines (one to many) AnytblStatements record can have many associated records in tblLines.The search criteria is against tblLines (ie tblLines.fldDateofService
Quote:
View 2 Replies
View Related
Mar 10, 2008
I have a select statement which accepts 2 variable in the "where" condition.
select username from user where variable1 like variable2. But the problem is in the left side of "like" statement if i use fieldname i get the result , but if i use variable name to represent a fieldname then i dont get the result.
Any ideas??
View 6 Replies
View Related
Apr 14, 2004
I have a report in SQL that passes parameters at runtime entered by the user for two date ranges (beginning and ending). I'm trying to write a formula that will print a specific field *only if* the specified date range entered by the user is BETWEEN a specific value (like 200401). This is kind of reverse of a normal WHERE, BETWEEN clause.
I tried a standard BETWEEN predicate in my WHERE clause like:
IF '200401' BETWEEN ?BegPer and ?EndPer then salesanal.ptdbud01 else 0
But, it's returning an error that my Then statement is missing. I can't use a normal statement like 'IF ?BegPer >= '200401' and ?EndPer <= '200401', then.....' because users could enter a RANGE of periods, so it would be difficult to code all of the possible combinations this way. I'm actually doing this in Crystal, but if someone can give me a standard MSSQL example, I can translate that over to Crystal.
Thanks in advance,
Michelle
View 4 Replies
View Related
Jan 4, 2007
I want to see all the fields list on the left side of report layout, you can drag a field and put it on the report.
Thank you very much.
View 5 Replies
View Related
Jul 9, 2015
I added the row group to show up as the tree view in the left side of the report. But I need it to display the records in the report detail for just that group value for the records when I clicked the group value from the tree view list.
Currently, it‘s not doing that. It takes me to that page where the group value is listed but it lists all other records too (which I don't want).
View 4 Replies
View Related
Jan 25, 2015
-- Why is the left table in a LEFT JOIN limited by the where clause on the right table?eg
DECLARE @LeftTable TABLE (LeftID INT NOT NULL IDENTITY(1, 1), LeftValue INT NULL)
INSERT @LeftTable (LeftValue)
VALUES (111)
INSERT @LeftTable (LeftValue)
VALUES (222)
[code]....
View 2 Replies
View Related
May 25, 2012
I have tables A and B.
Table A has data, but B may have or not.
I have to get -- at least! -- the A table data.
It works when I dont have the where clause:
select * from A left outer join B on A.IDUser = B.IDUser
But it doesn't when I try to use the WHERE clause:
select * from A left outer join B on A.IDUser = B.IDUser
where A.IDUser = 2
View 3 Replies
View Related
May 5, 2008
Hello,
I have two tables:
tasks
idint
useridint
otherstuff int
sample rows:
1,11,2
2,11,2
times
idint
taskidint
startweekdatetime
statusint
sample rows:
1,1,'04/28/2008',1
2,1,'04/28/2008',1
2,2,'04/28/2008',1
I want to retrieve:
ALL [tasks] with [times].[status] for a specific user for a given week, whether rows exist in [times] or not.
Here's my query:
select tasks.id, times.status
from tasks
LEFT OUTER JOIN times ON tasks.id = times.taskid
where upt.userid=11 AND times.startweek='05/05/2008'
That just doesn't return any the records though for the 05/05/2008 date. Its as though I want to join with a WHERE clause on the [times] table. What can I do?
Thanks in advance,
Brian
View 2 Replies
View Related
Oct 29, 2007
Hello,I'm trying to link two tables... one for Employees and the other forTimecardsI need to get a list of employees that do not have timecards on anSPECIFIC DATEI tried the follonwingSELECT Employess.EmployeeIDFROM Employees LEFT OUTER JOIN Timecards on Employees.EmployeeID =Timecards.lmpEmployeeIDWHERE lmpEmployeeID is NULL and lmpTimecardDate = '10/24/2007'But it doesn't work. However, when I comment the date condition out(lmpTimecardDate = '10/24/2007') it works all right but It's not whatI needAnother interesting point... if I use the following query... it worksall rightSELECT Employess.EmployeeIDFROM EmployeesWHERE Employees.EmployeeID not in (select Timecards.EmployeeID fromTimecardswhere TimecardDate = '10/24/2007')I'd like to be able to use the Left Outer Join option.... Am I doingsomething wrong?... or is it that if It doesn't like the condition I'musgin in the WHERE clause (TimecardDate = '10/24/2007')Thanks for your helpPablo
View 3 Replies
View Related
Dec 1, 2006
I have a query in and OLEDB Source which results in incorrect rows returned due to its structure:
SELECT table1.ABCD, table2.BAAA, table3.CAAA, table4.DAAA, table5.EAAAFROM table1LEFT OUTER JOINtable3 ON table1.ABCD = table3.BCDE LEFT OUTER JOINtable4 ON table1.ABCD = table4.CDEF LEFT OUTER JOINtable5 ON table1.ABCD = table5.DEFG LEFT OUTER JOINtable2 ON table1.ABCD = table2.EFGHWHEREtable1.extractSession = ?AND table3.extractSession = ?AND table4.extractSession = ?AND table5.extractSession = ?AND table2.extractSession = ?
The correct query needs to be the following, but it won't work in the OLE DB Source:
SELECT table1.ABCD, table2.BAAA, table3.CAAA, table4.DAAA, table5.EAAAFROM table1LEFT OUTER JOINtable3 ON table1.ABCD = table3.BCDE AND table3.extractSession = ?LEFT OUTER JOINtable4 ON table1.ABCD = table4.CDEF AND table4.extractSession = ?LEFT OUTER JOINtable5 ON table1.ABCD = table5.DEFG AND table5.extractSession = ?LEFT OUTER JOINtable2 ON table1.ABCD = table2.EFGH AND table2.extractSession = ?WHEREtable1.extractSession = ?
=========================
ExtractSession is an integer that uniquely identifies the run (for the night, perhaps). I load a bunch of staging tables that retain their data for a period of time, with each load identified by this staging number. So, I need to restrict my data pull to the correct load (extractSession).
The first query returns three (3) rows when I should be getting back all 250,000 rows from table1. The second query listed works correctly.
Am I missing something, or do I need to find another way to constrain my tables' extract session dynamically at execution time in SSIS? Is a control table the best way to go here and simply join to it?
Thanks,
Phil
View 1 Replies
View Related
Nov 20, 2006
hi ,
what is the definition and difference between predicate and residual predicate.
give me some examples..Basically the columns used in where clause are called as predicates. Am i right.
View 1 Replies
View Related
Aug 31, 2006
I have a Windows 2003 Server running IIS 6.0 and SQL Server 2005. I have just (Today) deployed the first ASP.NET application (developed in Visual Studio 2003 and, as such, dependent on .NET Framework 1.1) on this server and am getting HTTP Error 403 (You are not authorized to view this page). This ASP.NET application runs fine on another server that is configured with the OS=Windows Server 2003, IIS=6.0 but without SQL Server 2005 and without the .NET Framework version 2.0. I found in the IIS Application configuration (on the troublesome site) that my app (in the Default Web Site folder) was pointing to the version 2.0 aspnet_isapi.dll. All efforts to use aspnet_regiis to "re-align" my app with version 1.1 have been fruitless to eliminate the HTTP Error 403. I granted the NETWORK SERVICE account privledges to the wwwroot folder. At this point, I don't know if I have a Framework error or a privileges problem.
Please help.
Thanks,
Rob
View 1 Replies
View Related
Feb 6, 2007
I am trying to migrate from my current system, where I do merge replication from Windows Mobile devices running SQL Server CE 2.0 to a central database running SQL Server 2000 sp3a. I want eventually to move to a system running SQL Server 2005 CE replicating to a SQL Server 2005 back-end. But the transition will need to be gradual, and I may have to support both systems for a while until I can convert all clients from the old system to the new. I also need to do thorough testing.
So ... I'm trying to set up a test environment giving me the maximum possible flexibility to do my testing. Ideally, I'd like to set up SQL Server 2000 and SQL Server 2005 on a side-by-side basis, in a manner that would potentially allow mobile devices running both SQL Server CE 2.0 and SQL Server 2005 CE to sync with either back-end server.
Can someone provide me with guidance as what is possible to set up here? I know that SQL Server 2000 and 2005 can be installed side-by-side on the same server. It also appears that you can set up SQL Server 2000 so that EITHER SQL Server CE 2.0 OR SQL Server 2005 CE can sync with SQL Server 2000 (see www.microsoft.com/sql/editions/sqlmobile/connectivity-tools.mspx), but I don't know if it's possible for BOTH SQL Server CE 2.0 AND SQL Server 2005 CE to sync to the same SQL Server 2000. As for SQL Server 2005 ... it appears to be possible to set up SQL Server 2005 so that BOTH SQL Server CE 2.0 devices AND SQL Server 2005 CE devices can sync to the same SQL Server 2005 (see web page cited above). However, I don't know if it's possible to set up a SQL Server 2005 server installation in this manner while at the same time having a side-by-side SQL Server 2000 installation supporting any level of mobile merge replication.
HELP!!!!
View 7 Replies
View Related
Feb 29, 2008
Hello friends....
my question is as follows:
How do I send the data from the server side to the client side specifically in what format and what kind of connection do I use?
waiting for answers.....
View 5 Replies
View Related
Mar 24, 2014
I'm using SQL Server 2008 R2 BIDS to accomplish this.
View 7 Replies
View Related
Nov 11, 2014
I will soon be embarking on an upgrade of a transaction replicated database (Push) from 2005 to 2012 SP2.The publisher, distributor and subscriber are 3 separate machines.There databases will be detached, MDF and LDF will be copied across. Once attached, replication will be set up from scratch.
The name of the new servers are NOT the same as the existing ones.Should I completely remove transaction replication user the wizard and unticking the DB from being a database for transactional replication or just stop the log reader agent?How can I make sure the last of the transactions have gone across before I detach?Should I detach the subscriber first or the publication? Does it even matter?
Is there a better way of moving across the databases? I for one would have preferred to backup (.bak) then restore on the other side. I'd love to hear opinions on this as well.
View 0 Replies
View Related
Nov 26, 2014
I am working to create a phone list that will contain Last Name, First Name, and Phone Number sorted by last name. For printing purposes I would like to have three columns of data instead of the standard of one column.
Is it possible to create a query to present data in three columns showing the data side by side?
View 9 Replies
View Related
Feb 23, 2008
will this create a separate instance?
Is there anything I need to be aware of?
Thank you.
Greg
View 3 Replies
View Related
Apr 28, 2007
I have downloaded and installed VS C# Express Orcas beta 1. It appears that Express editons ov VS can only connect to SQL2005 Express and not to a high end edition which I have on my computer. In one of the Orcas forums, it was suggested that I can install SQL2005 Express side by side my high end SQL 2005. To play it safe, I wanted to get a confirmation from this forum before I do that. Is a side-by-side installation ok? thanks.
View 3 Replies
View Related
May 19, 2006
Is there anywhere I can compare side by side between 2005 SQL Server and 2005 SQL Server express Edition?
I just found out that the express version does not have the database Copy feature (When you right clink on the database object -> Tasks ) !
I don't know about the evel version since I have not install yet. Any idea ?
View 4 Replies
View Related
Jun 1, 2006
If I download sql server 2005 express edition, will it run side by side with my sql server 2000, or is it a one or the other situation?
smtraber
View 1 Replies
View Related
Apr 8, 2004
Hi,
In Analysis Services there is an option to enforce a role either on the client side or the server side.
Can someone kindly guide what's the recommended approach and what's really the difference between the two options.
Thanks.
View 1 Replies
View Related
Jul 23, 2015
would like to know if it's possible to install SQL Server Failover cluster instance with shared storage along with standalone installation with Always on ( always on uses WSFC underneath).
View 1 Replies
View Related
Dec 11, 2007
Hi people
Here is my case: I've a server running Windows server 2003 edition and SQL2000.
I've installed SQL2005 using the side-by-side method as described by MSFT docs. I've then copied the mdf & ldf files to new locations and attached the db in SQL 2005 management studio. Every thing fine. Next, I've migrated the DTSs using the DTS migration wizard. After this step I have some bad warnings in windows:
When I restart the server I get the following message: "mmc.exe Microsoft Management Console encountered a problem and needed to close".
Furthermore: I can't start the old SQL enterprise manager.
It shows another error "mmc.exe - Entry point Not Found" and closes it self.
The MSFT support page on this error relates it to Windows XP but my system is running Windows server....
Any one has any idea why this is happening?
Any suggested course of action?
Many thanks
ds9
View 3 Replies
View Related
Jan 21, 2008
Hello!
I was wondering if I can install/run SQL 2008 and 2005 side by side with SQL 2005 being default instance. Any issues with that?
Thanks,
Igor
View 2 Replies
View Related
Apr 24, 2015
When I try compare 2 years worth of data side by side. They go in separate grids. I know it is just a usability feature.
i would want see same month data for multiple years side by side.
View 5 Replies
View Related
Jul 15, 2007
having installed 2005 first and installed 2000 with both types of reports going to one 2005 home. i would like to have separate homes
with reports going their respective homes. Do i have to first unstall
2005 and do a new installation with a different report and server than
2000. I would like to avoid this and just fine tune 2000 with the rsconfig.exe. Help me out please.
View 1 Replies
View Related
Jan 9, 2006
Hai
My system is already installed with SQL server 2000 . Is it possible for me to install SQL server 2005 BETA CTP in the same machine and run both side by side.
Regards
View 3 Replies
View Related
Apr 3, 2008
All,
I was trying to do something like puting two tables side-by-side inside a list, and list itself is grouped by a field.
But for some reason, two tables are not organzied pararally even there is no page break inserted.
Please help. Tks in advance.
Alex
View 1 Replies
View Related
Apr 9, 2008
Hi,
I need to migrate from sql 2000 to 2005 and in place upgrade is not possible. I can move the databases, logins but can some one help me to migrate sqlmaint plans and dts packages to 2005.
Thanks,
Rajakanna
View 4 Replies
View Related
Dec 14, 2005
I have SQL Express installed on my desktop and want to install SQL Server Evaluation.
View 5 Replies
View Related
Jul 8, 2006
Hi all,
Is it possible to run SQL Server 2005 Dev Ed. and the Express edition side by side on my development platform?
Thanks,
Andy
View 7 Replies
View Related