Hi there, been using Access forever and noticed while learning SQL to query I can cut and paste the code from Access's "SQL view" tab into SQL server and the query runs. The problem I am having is as follows. Sometimes in Access I piggyback queries to get the answer I need. How would this translate into SQL?Here are my Access queries, the first one just applying some criteria to a few fields, a bit of a clean up.. SELECT [2011-12 Q3].GBICCHARGE, [2011-12 Q3].MASTERID, [2011-12 Q3].CONSUMP, [2011-12 Q3].BILLDAYSFROM [2011-12 Q3]WHERE ((([2011-12 Q3].GBICCHARGE)="WU10") AND (([2011-12 Q3].CONSUMP)>0) AND (([2011-12 Q3].BILLDAYS) Between 42 And 100));
Then for some grouping and calculations I apply, SELECT Query24.MASTERID, Sum(Query24.CONSUMP) AS SumOfCONSUMP, Sum(Query24.BILLDAYS) AS SumOfBILLDAYS, 1000*[CONSUMP]/[BILLDAYS] AS Expr1FROM Query24GROUP BY Query24.MASTERID, 1000*[CONSUMP]/[BILLDAYS];
The second query is referencing the first query. Kind regards, MQBe who you are and say what you feel, because those who mind don't matter and those who matter don't mind.