Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm building a little Music Database with following tables:

Tables with relations

I would like to sum up the total count of tracks in the Table 'albums' as calculated field. I created a Query with SQL that groups to albumtitles and shows the count of songs related to those albumtitles:

SELECT albums.AlbumTitle AS AlbumTitel, Count(songs.PK_songs_ID) AS TotalSongs
FROM songs INNER JOIN albums ON albums.PK_albums_ID = songs.FK_album_ID
GROUP BY albums.AlbumTitle;

That query works fine, but I don't know how to get the total count calculated in a calculated field. I need this field to be able to check in a formular if the tracklist is complete (the formular shows the artist and in a sub-form a list of all albums from this artist).

So, how do I get the 'TotalSongs' field in 'albums' working?

share|improve this question
You named the TotalTracks field as TotalSongs in the SQL query. – wbeard52 Jun 30 '12 at 1:05
yes, but that doesn't really matter as long as I'm using only one name in my whole query. Nevertheless I changed it now. – wullxz Jul 23 '12 at 21:43

You must log in to answer this question.

Browse other questions tagged .