invalid syntax...

T

Tom

I have five columns in a query that display dates only
(data type is date). I need to create a report of the
query that shows in 'BOLD' dates no later than the past
30 days. I used the following code in the criteria field of
the date columns, but got an invalid syntax error (it
says 'you may have entered an operand without an
operator'):

if DateDiff("d",[DateField],date) <=30 then
[DateField].FontBold = true
else
[DateField].FontBold = false
end if

What could be wrong?
 
F

Fredg

Tom,
Where did you put this code? In the query?

This is from your previous original post:
I need to create a report of the
query that shows in 'BOLD' dates no later than 30 days.

The code works in a Report's Detail Format event.
A query does not support this type of formatting.
Use your query as the recordsource of a report.

In any event, you must change my generic [DateField]
to whatever the actual name of the field is.
--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


Tom said:
I have five columns in a query that display dates only
(data type is date). I need to create a report of the
query that shows in 'BOLD' dates no later than the past
30 days. I used the following code in the criteria field of
the date columns, but got an invalid syntax error (it
says 'you may have entered an operand without an
operator'):

if DateDiff("d",[DateField],date) <=30 then
[DateField].FontBold = true
else
[DateField].FontBold = false
end if

What could be wrong?
 
T

Tom

Fred,
Sorry, I was using it in the query.
Now I used it in the reports design view (code:
detail/format). But the all dates are in Bold, no matter
if days are later than 30 days. Below the expression

if DateDiff("d",[LC Sent],date) <=30 then
[LC Sent].FontBold = true
else
[LC Sent].FontBold = false
end if
 
T

Tom

It worked !!!!!!!!!!!!
I cannot believe this, the problem was [LC sent] wasn't in
the detail section.
Many thanks FRED
 

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

invalid syntax 2
Current Date in Query 12
Help with Query syntax 2
invalid vertical bar 2
Using Nz in a Totals Query 2
SQL Mix up? 3
DateDiff & 30 days 7
DateDiff returning incorrect years 11

Top