Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Queries

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 12-28-2008, 10:56 AM
Novice
 
Join Date: Dec 2008
Posts: 1
gbackus is on a distinguished road
Default Can anyone help me convert this union query into something that will work in access?

I believe my problem may be that access does not recognize implicit joins, unfortunately it's been a long time since I've written anything with explicit joins.

Can anyone help me convert the following into code that has explicit joins so that it will work in access?

select table1.field1, table2.field2, table1.field3, table3.field4, table1.field5, table4.field6 , table4.field7, table4.field8, table4.field9, table4.field10, table4.field11, table3.field12, table1.field13, table1.field14, table1.field15, table1.field16, table1.field17
from table 1, table 2, table 3, table 4
where
table1.voucher = table3.voucher
and table2.field1 = table1.field1
and table4.voucher = table3.voucher
and table4.field12 = table3.field12
--and table4.field8 = '2009'
--and table1.duedte <= '12/31/2050'
--and table1.amtdue <> 0
and table1.field4 = 'O'-- or table1.field4 = 'S')
--and table3.field4 != 'P' and table2.field1 = table1.field1
--and table1.field1 = '04666'
and table1.effdt between 01/01/80 and 12/31/08


union

select table1.field1, table2.field2, table1.field3, table3.field4, table1.field5, table5.field6, table5.field7, table5.field8, table5.field9, table5.field10, table5.field11, table3.field12, table1.field13, table1.field14, table1.field15, table1.field16, table1.field17
from table 1, table 2, table 3, table 5
where
table1.voucher = table3.voucher
and table2.field1 = table1.field1
and table5.voucher = table3.voucher
and table5.field12 = table3.field12
--and table5.field8 = '2009'
--and table1.duedte <= '12/31/2050'
--and table1.amtdue != 0
and table1.field4 = 'O' --or table1.field4 = 'S')
--and table3.field4 != 'P'
--and table1.field1 = '04666'
and table1.effdt between 01/01/80 and 12/31/08
order by table1.field1
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Forms don't work the same hawzmolly Access 0 12-18-2008 02:46 PM
Convert string to date ~SwAmPdOnKeY~ Queries 4 09-11-2008 05:19 PM
Can't get TransferSpreadsheet to work Valeda Import/Export Data 0 07-19-2007 06:04 AM
Trouble opening MS Access net work file from PC with Vista Dallas Retro Access 0 05-18-2007 12:49 PM
Nested IIf query will not work ddog171 Queries 1 06-20-2006 12:03 PM


All times are GMT -8. The time now is 02:56 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.