Link to home
Create AccountLog in
Microsoft Access

Microsoft Access

--

Questions

--

Followers

Top Experts

Avatar of Fred Fisher
Fred Fisher🇺🇸

Setting up an SQL query for Song Title
User generated imageUser generated imageI have created a custom music database.  I wish to create a way to query the database for a song name.  So far I have created a sql query for "Rudolph The Red Nosed Reindeer"

SELECT tblTitles.TitleID, tblMediaType.MediaTypes, tblTitles.Title, qrySongTitle.MediaTitle, tblTitles.TitleNumber, tblTitles.GroupPerformer, qrySongTitle.SongTitle, qrySongTitle.SideDiscNumber, qrySongTitle.SongPosition, qrySongTitle.SongType, qrySongTitle.SongLength, tblTitles.MediaType
FROM (tblMediaType INNER JOIN tblTitles ON tblMediaType.[MediaTypeID] = tblTitles.[MediaType]) INNER JOIN qrySongTitle ON tblTitles.[TitleID] = qrySongTitle.[MediaTitle]
WHERE (((qrySongTitle.SongTitle)="Rudolph The Red Nosed Reindeer"))
ORDER BY tblMediaType.MediaTypes;

I would like to create an action that will bring up a form to get the Song to search for, put that into a variable and plug that variable into the above SQL statement programmatically.  I have created a report that would then display the results of the query as seen in the attached file.

I have it working manually be typing in the Song to search for in the SQL statement, saving the SQL Query and then opening the report.

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Pavel CelbaPavel Celba🇨🇿

I don't tell how to implement the entry form but I have a few notes to your WHERE clause:

1) Why so many parentheses? If you remove them then it looks much simpler
WHERE qrySongTitle.SongTitle = "Rudolph The Red Nosed Reindeer"

2) Why are you using the exact match? SQL allows to ask for a beginning of the title:
WHERE qrySongTitle.SongTitle LIKE "Rudolph The Red%"

or you may even search for a substring:
WHERE qrySongTitle.SongTitle LIKE "%The Red%"

BTW, No file is attached to your question.
I've added SSRS topic to the question.

Avatar of ste5anste5an🇩🇪

hmm, looks like the MS Access query designer.. which would explain the parentheses ;)

Avatar of Pavel CelbaPavel Celba🇨🇿

OK, I see the images finally.

So I've removed SSRS and added MS Access topic.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


ASKER CERTIFIED SOLUTION
Avatar of Fred FisherFred Fisher🇺🇸

ASKER

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account
Microsoft Access

Microsoft Access

--

Questions

--

Followers

Top Experts

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.