User Input of Date as a Query
I have a query which goes like this:
StockAnalytics.uDIX - StockAnalytics.dDIX > 0.5
AND (To开发者_StackOverflow中文版day1.uDIX - Today1.dDix) > 0.5
AND (Today2.uDIX - Today2.dDix) > 0.5
AND (Today1.uDIX - Today1.dDix) > (Today2.uDIX - Today2.dDIX)
AND (Today2.uDIX - Today2.dDIX) > (Today3.uDIX - Today3.dDIX)
AND StockAnalytics.[Date] > @Date
I am trying to take the input from the user on which date he wants to run the query. When I enter the date, it asks for the same input twice.
Anything wrong with this query?
Soham
EDIT: I don't think, I could get my problem across. When I use this code snippet, it works perfectly, except for the fact that, the dialog box, prompting the user to enter the Date, comes twice I don't want to have it pop twice. Only after the user has entered the "date" the second time, does the results come up
If you need to include a parameter twice as in:
SELECT Stuff
FROM ATable
WHERE FirstDate > [Please enter date: ]
AND SecondDate > [Please enter date: ]
Then include a parameter line:
PARAMETERS [Please enter date: ] DateTime;
SELECT Stuff
FROM ATable
WHERE FirstDate > [Please enter date: ]
AND SecondDate > [Please enter date: ]
Or better yet, use a form:
SELECT Stuff
FROM ATable
WHERE FirstDate > Forms!Dates!txtDate
AND SecondDate > Forms!Dates!txtDate
精彩评论