If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
Parameter Query?
Thanks for all your help Bob.
I deleted my query and started over with this: SELECT Birthdaysqry.KnownBy, Birthdaysqry.LastName, Birthdaysqry.Birthdate, Birthdaysqry.Month, Birthdaysqry.Day FROM Birthdaysqry WHERE (((Birthdaysqry.Month)=[Enter two digit month:])); Could not get it to work when I put PARAMETERS at the top. I Have [Enter two digit month:] as Criteria. And it works! Might be some things I am missing that will make it work better. I like the idea of only having to enter a single digit month but for now it's OK. Thanks again Hank Thanks again. "Bob Barrows [MVP]" wrote in message ... Hank wrote: Sorry, I don't understand. I replaced "PARAMETERS[Month] Short;" , with "PARAMETERS[Enter Month] Text (255);" in the SQL view but I still get blank results. ( I dont know what Text(255); is telling me.) I tried entering NOV and 11 for November - same results. If I remove the Crieteria "Enter Month:" in the design view, I am still prompted to enter a month. Then, no mater what month I enter (Nov or 11), the results is every birthday in every month. What did I do wrong? "Bob Barrows [MVP]" wrote in message ... Hank wrote: SQL View: PARAMETERS [Month] Short; This is wrong. It should say: PARAMETERS [Enter Month] Text (255); Instead of requiring your users to enter the leading zeroes, you might try using the Month() function instead: PARAMETERS [Enter Month] Short; SELECT StudentsTbl.StudentID, StudentsTbl.KnownBy, StudentsTbl.LastName, StudentsTbl.Birthdate, Month([Birthdate]) AS [Month], Format([Birthdate],"dd") AS [Day] FROM StudentsTbl WHERE Month([Birthdate])=[Enter Month:] ORDER BY StudentsTbl.Birthdate, Format([Birthdate],"mm"); Now all the user has to enter for June dates is 6, instead of 06. And I just saw what you were doing wrong: you had WHERE (((Format([Birthdate],"mm"))="Enter Month:")) And you should have had: WHERE (((Format([Birthdate],"mm"))=[Enter Month:])) -- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM" |
|
Thread Tools | |
Display Modes | |
|
|