Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.