Upgrading MDB SQL to ADP

  • Thread starter Thread starter kevin Flock
  • Start date Start date
K

kevin Flock

I have the following Query in MDB with linked tables and
it works fine. However I do not understand enough of the
syntax for converting this for SQL. I keep running into
problems with the "between" and "and."

Any help would be greatly appreciated.

Thanks,

Kevin

SELECT dbo_ED.edProject AS Project, Sum(IIf
((dbo_ED.edAccount Between "6000" And "64999") And
edProjectCost,edAmount,0)) AS JTDDirOtherCost, Sum(IIf
((dbo_ED.edAccount Between "50000" And "54999") And
edProjectCost,edAmount,0)) AS JTDReimbOtherCost, Sum(IIf
((dbo_ED.edAccount Between "70000" And "79999") And
edProjectCost,edAmount,0)) AS JTDIndCost, Sum(IIf
(edTransType='IN' And (dbo_ED.edAccount>="40000" Or IsNull
(dbo_ED.edAccount)) And nz(edSubType)<>'I' And
dbo_ED.edAutoEntry=False,-dbo_ED.edAmount,0)) AS
JTDTotBill, Sum(IIf(edTransType='CR',-dbo_ED.edAmount,0))
AS JTDRecv
FROM dbo_ED
GROUP BY dbo_ED.edProject;
 
Back
Top