Basic Syntax Problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can anyone please tell me what is wrong the following syntax in an unbound
text box inside a report or suggest a better method?

iif([Forms![Date Input Form]![Desired Date],"Forms![Date Input
Form]![Desired Date], "Forms![Date Input Form]![Begin Date] & ' until ' &
Forms![Date Input Form]![End Date]")

I get an error that says
"Syntaz error (missing operator) in query expression
'First([iif[Forms]![Date Input Form]![[Desired Date],"Forms]![Date Input
Form![[Desired Date], "Forms]![Date Input Form]![[Begin Date] & ' until ' &
Forms]![Date Input Form]![[End Date]")])'

Basically all I want it to do is either print out a single date, if
available, or just a string concatinating 2 dates and the word 'until'
between them. Is there an easier way to do this than what I'm doing?

Thanks,
Keith
 
The first argument in an IIF statement has to be an expression. Try changing
it to this:

iif([Forms![Date Input Form]![Desired Date] Is Not Null,Forms![Date Input
Form]![Desired Date], Forms![Date Input Form]![Begin Date] & " until " &
Forms![Date Input Form]![End Date])
 
Adding the "Is Not Null" got rid of the syntax error, but now I just get a
#name. I thought it might need quotations around the if-true and if-false
statements, but I'm apperently not getting the right combinations, especially
with the trying to add in the 'until' part. Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

How to count duplicated date 13
need help with this 20
Date Diff Issue 4
Access Property sheet data missing also syntax 0
Enter Parameter Value Date 2
user paramaters 4
Problem with date criteria in Query 2
Data Entry Form 3

Back
Top