I'm not at all confident in SQL, simple selects and inserts is about it....however, I have a requirement to do the following:
I have a table in Access with airline tickets listed. There's a FromCity, ToCity, CurrentPrice, FlightDate and lots more irrelevant fields. What I'm trying to create is a query that will show me these 3 fields for each individual ticket that has a CurrentPrice < 0.8*AVG(CurrentPrice) for it's combination of FromCity / ToCity on each day in the entire dataset.
I could VBA it and bring back each combination of From / To in turn and a run a query on each one.....but I'm hoping there's a way to do this in one query in SQL. Oh and results are coming into an Excel page so I'm ADOing it and running SQL on the Access table from Excel VBA rather than using an Access form.
Even pointing me a direction to start in would be huge assistance here. My SQL is terrible.
Bookmarks