Re: Help: INNER JOIN

2008-03-06 Thread s. isaac dealey
When using an access database, I would instead of using inner join syntax (which I normally prefer) put those join conditions in the where clause... FROM Constintuency c, PollinstStation s, VoteResults v WHERE s.ConstituencyNo = c.ConstituencyNo and v.AgentPhoneNo = v.AgentPhoneNo and

Re: Help: INNER JOIN

2008-03-06 Thread Steve Bryant
the following query in ColdFusion but I am getting an error > buy I can't understand what I am doing wrong. I will appreciate any > help I can get: > > SELECT c.ConstituencyName, s.ConstituencyNo, c.RegionCode, SUM(v. > Votes) AS TotalVotes > FROM Constitu

Help: INNER JOIN

2008-03-06 Thread Fawzi Amadu
I have the following query in ColdFusion but I am getting an error buy I can't understand what I am doing wrong. I will appreciate any help I can get: SELECT c.ConstituencyName, s.ConstituencyNo, c.RegionCode, SUM(v.Votes) AS TotalVotes FROM Constituency c INNER

Re: Adding Extra Conditions to an INNER JOIN

2008-03-04 Thread Joe Graves
Replace your Where with an "AND/OR" The where clause must be used after any inner joins SELECT v.Party, SUM(v.Votes), s.ConstituencyNo ,c.ConstituencyName, c. RegionCode FROM VoteResults v INNER JOIN PollingStation s --- ON v.Ag

Re: Adding Extra Conditions to an INNER JOIN

2008-03-04 Thread Sonny Savage
" and it should work. > > Although, in this case, there is no benefit to putting the additional > criteria within the INNER JOIN. You may as well just specify a WHERE > clause. > > It does make sense, however, to specify additional criteia in an OUTER > JOIN. > > ht

RE: Adding Extra Conditions to an INNER JOIN

2008-03-04 Thread Dawson, Michael
Change your "WHERE" to an "AND" and it should work. Although, in this case, there is no benefit to putting the additional criteria within the INNER JOIN. You may as well just specify a WHERE clause. It does make sense, however, to specify additional criteia in

RE: Adding Extra Conditions to an INNER JOIN

2008-03-04 Thread Dave Watts
> I am trying to use INNER JOIN for my query and have > additional conditions, what is the right way to add them? > When I run the code below, I get the error shown. How do I > get this to work? > > SELECT v.Party, SUM(v.Votes), s.ConstituencyNo > ,c.ConstituencyNa

Adding Extra Conditions to an INNER JOIN

2008-03-04 Thread Fawzi Amadu
I am trying to use INNER JOIN for my query and have additional conditions, what is the right way to add them? When I run the code below, I get the error shown. How do I get this to work? SELECT v.Party, SUM(v.Votes), s.ConstituencyNo ,c.ConstituencyName, c.RegionCode FROM VoteResults v INNER

RE: Inner Join Across Two Data Sources?

2006-09-29 Thread James Smith
> I see where I can create the linked server, but the foxpro > database and the SQL database are on the same server. When I > enter the name of the server, it says I cannot create the > local server as a linked server. My MSSQL and MySQL servers are both on the same box and it works fine here.

Re: Inner Join Across Two Data Sources?

2006-09-28 Thread Jim Wright
Tim Claremont wrote: > I see where I can create the linked server, but the foxpro database and the > SQL database are on the same server. When I enter the name of the server, it > says I cannot create the local server as a linked server. > > To clarify, the FoxPro database is in a directory on t

RE: Inner Join Across Two Data Sources?

2006-09-28 Thread loathe
Maybe try by IP? The linked server thing is neat, I'm going to have to look into it some more. > -Original Message- > From: Tim Claremont [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 28, 2006 1:40 PM > To: CF-Talk > Subject: Re: Inner Join Across Two Data

Re: Inner Join Across Two Data Sources?

2006-09-28 Thread Tim Claremont
I see where I can create the linked server, but the foxpro database and the SQL database are on the same server. When I enter the name of the server, it says I cannot create the local server as a linked server. To clarify, the FoxPro database is in a directory on the same server as the SQL Serv

RE: Inner Join Across Two Data Sources?

2006-09-28 Thread Porter, Benjamin L.
large that they crash cf. -Original Message- From: Aaron Rouse [mailto:[EMAIL PROTECTED] Sent: Thursday, September 28, 2006 11:52 AM To: CF-Talk Subject: Re: Inner Join Across Two Data Sources? How do you setup the link between MS SQL and FoxPro? Seems like that is the only way that cou

RE: Inner Join Across Two Data Sources?

2006-09-28 Thread James Smith
> Yup. I am aware of that. I was hoping to get away with one > query, but apparently I am doing it as efficiently as > possible already. In enterprise manager go into "security > Linked Servers". I have never tried with fox pro but I have my MySQL server and MSSQL servers working together nicel

Re: Inner Join Across Two Data Sources?

2006-09-28 Thread Tim Claremont
Yup. I am aware of that. I was hoping to get away with one query, but apparently I am doing it as efficiently as possible already. Thanks Tim >No, but you could do three queries and end up with the same result using >query of queries. > >> ~~~

Re: Inner Join Across Two Data Sources?

2006-09-28 Thread Aaron Rouse
How do you setup the link between MS SQL and FoxPro? Seems like that is the only way that could be done in a single query. On 9/28/06, Andy Matthews <[EMAIL PROTECTED]> wrote: > > Should be able to. Reference the fields like so: > > SELECT dt.fieldname > FROM database1.tab

RE: Inner Join Across Two Data Sources?

2006-09-28 Thread Andy Matthews
Should be able to. Reference the fields like so: SELECT dt.fieldname FROM database1.table1 d1t1 INNER JOIN database2.table1 d2t1 ON d2t1.id = d2t1.id -Original Message- From: Tim Claremont [mailto:[EMAIL PROTECTED] Sent: Thursday, September 28, 2006 11:15 AM To: CF-Talk Subject

RE: Inner Join Across Two Data Sources?

2006-09-28 Thread loathe
No, but you could do three queries and end up with the same result using query of queries. > -Original Message- > From: Tim Claremont [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 28, 2006 12:15 PM > To: CF-Talk > Subject: Inner Join Across Two Data Sources?

Inner Join Across Two Data Sources?

2006-09-28 Thread Tim Claremont
I have two databases. One is in SQL Server, and the other is in FoxPro. Can I perform a single CFQUERY that includes one table in each data source and joins the two based on say... ClientNum? ~| Introducing the Fusion Authority

RE: INNER JOIN

2005-09-29 Thread Andy Matthews
Stuart... Just FYI...it'll REALLY help with readability, both for you and for us, if you alias your tables. Like so: You simply use the AS keyword after the table name in your FROM and INNER JOIN statements. FROM tablename AS alias Or you can do it the easy way and leave off the AS ke

Re: INNER JOIN

2005-09-29 Thread Saturday (Stuart Kidd)
it. > > Ian > > >> -Original Message- >> From: Saturday (Stuart Kidd) [mailto:[EMAIL PROTECTED] >> Sent: 29 September 2005 12:37 >> To: CF-Talk >> Subject: Re: INNER JOIN >> >> Hi, >> >> I've simplified it a bit: >> >> >

RE: INNER JOIN

2005-09-29 Thread Ian Tait
You need to use something like ORDER BY authorID if you're grouping on it. Ian > -Original Message- > From: Saturday (Stuart Kidd) [mailto:[EMAIL PROTECTED] > Sent: 29 September 2005 12:37 > To: CF-Talk > Subject: Re: INNER JOIN > > Hi, >

Re: INNER JOIN

2005-09-29 Thread Saturday (Stuart Kidd)
cleID, tbl_020articleDetails.articleTitle FROM tbl_020articleDetails INNER JOIN tbl_020authorDetails ON tbl_020articleDetails.authorID = tbl_020authorDetails.authorID WHERE tbl_020authorDetails.authorPhotograph <> '' AND tbl_020articleDetails.articleSubTypeID <>

RE: INNER JOIN

2005-09-29 Thread Adrian Lynch
A quick suggestion, write a test page with the minimum of code in. It'll make it easier for you to debug and easier for us to help. Ade -Original Message- From: Saturday (Stuart Kidd) [mailto:[EMAIL PROTECTED] Sent: 29 September 2005 10:50 To: CF-Talk Subject: INNER JOIN Hi, I&#x

INNER JOIN

2005-09-29 Thread Saturday (Stuart Kidd)
rname, tbl_020authorDetails.authorPhotograph, tbl_020authorDetails.authorAboutMe, tbl_020articleDetails.articleID, tbl_020articleDetails.articleTitle FROM tbl_020articleDetails INNER JOIN tbl_020authorDetails ON tbl_020articleDetails.authorID = tbl_020authorDetails.authorID

RE: inner join help

2005-01-15 Thread Michael T. Tangorre
> From: Daniel Farmer [mailto:[EMAIL PROTECTED] > I am getting a 'missing operator error below'. I don't know what > operator its looking for. You and Protoculture working the same code or what? ~| Find out how CFTicket can i

inner join help

2005-01-15 Thread Daniel Farmer
m_categories_sub4.id INNER JOIN auction_item_categories_sub3 ON auction_item_categories_sub4.categoryy_id = auction_item_categories_sub3.id INNER JOIN auction_item_categories_sub2 ON auction_i'. Attach Code SELECT id, category_id, name FROM auction_item_categories_sub5, auc

RE: Arrrgh...that's not good...Re: Pagination (Next n records) fo r an inner join and grouped output...

2003-06-12 Thread Costas Piliotis
...that's not good...Re: Pagination (Next n records) fo r an inner join and grouped output... No you can't. When you use aggregate functions in an SQL statement you MUST put all of the fields you are selecting into the GROUP BY clause. That means you will need two queries since you want to s

RE: Arrrgh...that's not good...Re: Pagination (Next n records) fo r an inner join and grouped output...

2003-06-12 Thread Bryan Love
l Message- From: Jeff [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 2:03 PM To: CF-Talk Subject: Re: Arrrgh...that's not good...Re: Pagination (Next n records) fo r an inner join and grouped output... on 6/12/03 4:47 PM, Bryan Love at [EMAIL PROTECTED] wrote: > Post the code y

Re: Arrrgh...that's not good...Re: Pagination (Next n records) fo r an inner join and grouped output...

2003-06-12 Thread Jeff
't know how many total > pages there are. Can I somehow calculate that DURING the inner join query below? I tried to add it to the SELECT statement with disastrous results... SELECT * FROM (tblRentalLocations INNER JOIN tblRentalProperties ON tblRentalLocations.LocationID=tblRental

Re: Okay, is this possible? Re: Arrrgh...that's not good...Re: Pagination (Next n records) for an inner join

2003-06-12 Thread Jeff
a second query with the same criteria, but just query for that one > field and do a DISTINCT on it, then your recordcount for that query should > be the number of distinct values for that field. Man, I totally tried this, but my query just gave the most horrible errors... Watch... SELECT * FR

RE: Arrrgh...that's not good...Re: Pagination (Next n records) fo r an inner join and grouped output...

2003-06-12 Thread Bryan Love
merican Crisis "Let's Roll" - Todd Beamer, Flight 93 -Original Message- From: Jeff [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 12:08 PM To: CF-Talk Subject: Arrrgh...that's not good...Re: Pagination (Next n records) for an inner join and grouped

Re: Okay, is this possible? Re: Arrrgh...that's not good...Re: Pagination (Next n records) for an inner join

2003-06-12 Thread Scott Weikert
>Is there some way to calculate #DistinctPropertyCount# some way from the >results of the query? In this case, the RecordCount is correct (10 rows >returned) but what I *really* need is the number of *properties* that are >returned... You could create a structure, with keys being the value of the

Okay, is this possible? Re: Arrrgh...that's not good...Re: Pagination (Next n records) for an inner join

2003-06-12 Thread Jeff
Okay, how about this... Is there a function or a combination of functions that I can use on the query results to find the distinct PropertyIDs from a join query? Say my query returns 10 rows. 2 distinct properties, with 6 rates for one, and 4 rates for another...so grouped output looks like this:

Arrrgh...that's not good...Re: Pagination (Next n records) for an inner join and grouped output...

2003-06-12 Thread Jeff
on 6/12/03 2:34 PM, Bryan Love at [EMAIL PROTECTED] wrote: > I've run into this one before and it sucks. Your best bet, if you want the > number of unique property ids is to run another query that does a > SELECT COUNT DISTINCT propertyID AS pCount... > > But whether or not it will work to use t

RE: Pagination (Next n records) for an inner join and grouped out put...

2003-06-12 Thread Bryan Love
Talk Subject: Pagination (Next n records) for an inner join and grouped output... I've got an inner join that I'm trying to make work with paging the records and I *think* I see what the problem is, but I don't know how to proceed... The inner joins are working correctly. In fact,

RE: Pagination (Next n records) for an inner join and grouped out put...

2003-06-12 Thread Costas Piliotis
: Thursday, June 12, 2003 11:22 AM To: CF-Talk Subject: Pagination (Next n records) for an inner join and grouped output... I've got an inner join that I'm trying to make work with paging the records and I *think* I see what the problem is, but I don't know how to proceed... The

Pagination (Next n records) for an inner join and grouped output...

2003-06-12 Thread Jeff
I've got an inner join that I'm trying to make work with paging the records and I *think* I see what the problem is, but I don't know how to proceed... The inner joins are working correctly. In fact, when I go to output, I simply group them by property ID, and I get the right numbe

Re: INNER JOIN

2002-06-29 Thread S . Isaac Dealey
> What's the deal with ( tblEmployee.EmployeeID IS NOT NULL ) ? > Shouldn't your ON clause be relating one row in one table > to a row in another table? It depends on what you're trying to accomplish with the query -- and it turns out it doesn't work for him I _think_ because he's using Access .

Re: INNER JOIN

2002-06-29 Thread Matthew Walker
ent: Sunday, June 30, 2002 9:57 AM Subject: INNER JOIN > can you see whats wrong with this query? > error below > thanks > -paul > > > SELECT tblRelations.Relation_ID, > tblService.Service_ID, tblService.Service, > tblEmployee.EmployeeID, > LEFT(LTRIM(tblEmplo

INNER JOIN

2002-06-29 Thread Paul Ihrig
LEFT(LTRIM(tblEmployee.FirstName),1) + '.' AS employeeinitial FROM tblService INNER JOIN tblEmployee ON ( tblEmployee.EmployeeID IS NOT NULL ) LEFT JOIN tblRelations ON ( tblRelations.EmployeeID = tblEmp

RE: Composite primary key and INNER JOIN syntax

2001-11-26 Thread Andy Ewings
SELECT acs.ownerid, sts.siteid, sts.sitename FROM Accounts acc INNER JOIN AccountSites acs ON (acc.AccountID = acs.AccountID) INNER JOIN Sites sts ON (acs.OwnerID = sts.OwnerID) WHERE acs.Accountid = -- Andrew Ewings Project

Composite primary key and INNER JOIN syntax

2001-11-26 Thread Aidan Whitehall
Does anyone know the SQL to retrieve the OwnerID, SiteID and SiteName given a single AccountID value using the INNER JOIN syntax? (don't want to use = in the WHERE clause) Thanks if you can help! Accounts AccountID PK FullName AccountSites Acco