Forums

This topic is locked

SQL???

Posted 21 Jan 2002 20:58:00
1
has voted
21 Jan 2002 20:58:00 Irakli Garakanidze posted:
I'v got several tables: Donors, Projects, Sectors, State. Keys for Donors are like 1EU, 1EUTA, 1EBRD, 1FAO, 1USA...
in one page which is supposed to display Projects done by certain donor I have placed sql:

"SELECT [Projects].[Project], [Projects].[ProjectID], [Projects].[PMoney], [Projects].[Strat], [Projects].[Endd], [Projects].[StateID], [Projects].[PrType], [Projects].[DonorID], [Projects].[SectorID], [Projects].[Descr], [Donors].[Donor], [Sectors].[Sector], [State].[State] FROM State INNER JOIN (Sectors INNER JOIN (Donors INNER JOIN Projects ON [Donors].[DonorId] =[Projects].[DonorID]) ON [Sectors].[SectorID] =[Projects].[SectorID]) ON [State].[StateID] =[Projects].[StateID]
WHERE Projects.DonorID= '" + Replace(rpd__MMColParam, "'", "''" + "' ORDER BY " + Replace(rpd__ord, "'", "''" + " " + Replace(rpd__how, "'", "''" + ""

I took it from Access query and added variebles MMColParam, ord and how (The first for DonorID which comes from different page, ord - for sorting different fields and how - for sorting these fields ASC and DESC)

I made default for MMColParam - '1EU' -> Clicked "Test" _> Good, '1EUTA' -> "Test" - eveything OK, but '1FAO' or 1EBRD - window shows 'no data' I checked in database... I have a lot of projects done bu 1FAO and 1EBRD....
why??
SOS



Reply to this topic