Hello Doug, here is the SQL:
SELECT Transazioni.Importo, Transazioni.Note, Anagrafica.Nome,
Anagrafica.Cognome, Causali.Causale, Transazioni.Date,
Anagrafica.Indirizzo, Anagrafica.[Cap&Citta], Anagrafica.Provincia,
Anagrafica.SysDate, Anagrafica.Email
FROM Causali RIGHT JOIN (Anagrafica RIGHT JOIN Transazioni ON
Anagrafica.AnagraficaID = Transazioni.AnagraficaID) ON Causali.CausaleID
= Transazioni.CausaleID
WHERE (((Causali.Causale)=[Forms]![Reference]![Causals]) AND
((Anagrafica.SysDate)>=Format([Forms]![Reference]![DataDa],"\#yyyy-mm-dd\#")
And
(Anagrafica.SysDate)<Format([Forms]![Reference]![DataA],"\#yyyy-mm-dd\#")))
ORDER BY Transazioni.Date;
Again, thanks for you patience
What's the SQL of your query? (If you're not familiar with working with
the SQL generated by Access, open the query in Design view and switch
to SQL view under the View menu. Copy and paste the SQL into your
reply)
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
Hello Doug,
I have copied what you wrote. I get this error message:
"This expression is typed incorrectly, or it is too complex to be
evaluated. For example, a numeric expression may contain too many
complicated elements. Try simplifying the expression by assigning
parts of the expression to variables."
the same error happens if I only use one part of the string:
=Format([Forms]![Reference]![DataDa], "\#yyyy\-mm\-dd\#")
Thanks again for you patience
message Did you read the articles I cited? You cannot use dd-mm-yy. Just
because the format of the text box may be dd-mmm-yy doesn't mean that
the value used by the query actually is passed that way. Use the
Format function:
=Format([Forms]![Reference]![DataDa], "\#yyyy\-mm\-dd\#") And <
Format([Forms]![Reference]![DataA], "\#yyyy\-mm\-dd\#")
(Also, does your date field also include time? If so, use <= instead
of <)
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
I input the dates as 00-00-00 (for dd-mm-yy. When I tab to then next
box the date shows 00-LLL-00)
message What values are you typing in the text boxes? Note that regardless
of what your Short Date format may have been set to through
Regional Settings, Access is very picky about how dates must be
specified.
Check what Allen Browne has in "International Dates in Access" at
http://allenbrowne.com/ser-36.html or what I had in my September
2003 Access Answers column for Pinnacle Publication's "Smart
Access" newsletter. (The column and accompanying database can be
downloaded for free at
http://www.accessmvp.com/djsteele/SmartAccess.html)
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
hello there, I have applied the form.. I just have one (I hope)
last question.
My form contains 2 text boxes. 1 for the start date and the other
one for the end date.
This is what I wrote in the query's criteria :
=[Forms]![Reference]![DataDa] And <[Forms]![Reference]![DataA]
but all I get is an empty report. What do I do wrong?
thank you very much for your patience...
Lisa
message Assuming your query currently has a parameter [Something] in it,
you'd replace that with Forms![NameOfForm]![NameOfControl]
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
Hi Doug, thanks for your prompt reply... say I make this form
with all the criteria I need for the query... where do I put the
reference to that form in the query?
message You'd have to create your own form with the appropriate combo
box on it, and have your query refer to that combo box (using
Forms![NameOfForm]![NameOfComboBox], rather than whatever
parameter it's currently using. However, you'll have to ensure
that the form is open before you run the query: Access will not
open the form for you if it's not already open.
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
Hello everybody, I have a question concerning the "Enter
Parameter Value" window that opens when I run a query.
Is it possible to have that as a combobox so that a list of
possibilities is shown?
Another question has to do with the same query. This asks a
date from and to (in the query criteria >[from] And [to]. I
would like the selected period to be shown in the report. Is
this possible (and if so... how can I achieve that)?
Thanks for all the help you can give
--
Lisa
Save the Dogs Onlus -
www.savethedogs.eu
THINK BEFORE YOU PRINT: before printing this e-mail think
whether it is really necessary