I have been working on a sql statement all afternoon and it is starting to make me seriously doubt my abilities. I have a table, glentrdth which has some records I from which need to get records out for period 13 year 2009. However, this table only contains a glseq field which should correspond to records in another table called glentrdt which have the period, year, and glseq records in them. I also need to match these records with records in a table called armast to get a field called warehouse matching these records up based on invno value of both tables. Now this seems easy to me however every syntax I've tried yields four records for every one record I need. I know this may not make a lot of sense without access to the data but I'd really appreciate it if anyone would look at the sql statement below and tell me if anything obviously wrong jumps out at them:
SELECT glentrdth.glaccnt, glentrdth.glseq, glentrdth.glamount, glentrdth.invno, glentrdth.custno, glentrdt.year,glentrdt.period, armast.warehouse ; FROM t:\visprod\data06\glentrdth, t:\visprod\data06\armast, t:\visprod\data06\glentrdt ; WHERE glentrdth.invno = armast.invno AND glentrdth.glseq = glentrdt.glseq AND glentrdt.year = '2009' AND glentrdt.period = '13' AND glentrdth.glaccnt = '60120- ' ; INTO CURSOR junk this last iteration is going back to fox 2.6 syntax but I am working in vfp 9 so I'm not opposed to the newer join syntax it just wasnt getting me any better results. any help would be appreciated. -Jeff _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/bf974cff1001131408y697755a5p467a597cfd97e...@mail.gmail.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.