Sunday, December 11, 2011


SELECT Customers.FirstName, Customers.LastName, Accounts.Balance, Branch.Location
FROM Branch INNER JOIN (Customers INNER JOIN Accounts ON Customers.[CID] = Accounts.[CID]) ON Branch.BID = Accounts.BID
WHERE (((Branch.Location)="Central"))
ORDER BY Customers.LastName;

SELECT * From Accounts, Customers

This will give me the Cartesian Product of the
two tables

SELECT * From Accounts, Customers
WHERE Accounts.CID = Customers.CID

This is called an INNER JOIN

SELECT * From Accounts, Customers, Branch
WHERE Accounts.CID = Customers.CID
AND
Branch.BID = Accounts.BID


[SalePrice]/[SqFeet] AS PricePerSqFt

as part of the field list in a Select Query

[SaleSPrice]/[SqFeet] AS PricePerSqFt

Instead of
WhERE BID="b5"

Where BID=[TheBranchIDISupply]


Serial Numbers in Excel, Access?
the way we handle dates and times
dates are whole number offsets from Jan
0, 1900

times are fractions of whole numbers

Test 2:
Query 4:
Select Title, PublDate, LastName, PubName
From Book, Author, Publisher
WHERE Book.AuthorCode = Author.AuthorID
And Book.PubID = Publisher.PubID
And PubName="Wiley"
Order By Title Asc

And PubID = "WI"

Diff types of wildcards
?
*

Begins with: G*
Ends with: *ing
Contains: *Excel 2007*

SELECT [Waxman Commissions].LastName, Sum([Waxman Commissions].SalePrice) AS Fred, Avg([Waxman Commissions].MarketDays) AS AvgOfMarketDays, Sum([Waxman Commissions].Commission) AS SumOfCommission
FROM [Waxman Commissions]
GROUP BY [Waxman Commissions].LastName;

http://office.microsoft.com/en-us/access/


No comments:

Post a Comment