Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 related field in a table

Author  Topic 

dmaxj
Posting Yak Master

174 Posts

Posted - 2009-06-16 : 14:23:11
How can I access a related field in my query?

Date is a related field in another table named Events. This is an ODBC connections to a Filemaker table. I am trying to avoid an export by querying the live database.

My current query give the error 'Columne Not Found - Events::Date'

Is it possible to access related fields in my query?

Regards


SELECT DISTINCT patient_id
FROM table01
WHERE Events::Date >='1/1/2005'
ORDER BY patient_id

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-06-16 : 14:25:20
where are you trying the above query? also how are table01 & Events related?
Go to Top of Page

dmaxj
Posting Yak Master

174 Posts

Posted - 2009-06-16 : 14:40:40
I am trying this query in MS Visual Studio - Add New Report. The query is in one of my New Datasets.

The tables are related by patient_id.

patient_id is a primary key in Events table and patient_id is a foreign key in table01.

Regards
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-06-16 : 14:47:37
then query should be


SELECT DISTINCT t1.patient_id
FROM table01 t1
INNER JOIN Events e
ON e.patient_id=t1.patient_id
WHERE e.Date >='1/1/2005'
ORDER BY t1.patient_id
Go to Top of Page
   

- Advertisement -