report expression

A

Alylia

I would like assistance on how to extract information on a report from a
"number of days" field based on the following:

first 30 days
between 30 and 60 days
after 60 days

Please note that the datatype of the field is number.
 
M

Marshall Barton

Alylia said:
I would like assistance on how to extract information on a report from a
"number of days" field based on the following:

first 30 days
between 30 and 60 days
after 60 days

Please note that the datatype of the field is number.


There are several ways to do that kind of thing. Which one
is appropriate to your situation depends on what you are
trying to accomplish.
 
A

Alylia

Marshall Barton said:
There are several ways to do that kind of thing. Which one
is appropriate to your situation depends on what you are
trying to accomplish.

I want for data on each of the conditions to be returned in a text box. If
for example the number of days taken on a trip for condition 1 (below 30
days) happens to be 5, then 5 must be returned in the text box, if the number
of days between 30 and 60 happens to 10, then 10 should be returned in the
text box.
 
M

Marshall Barton

Alylia said:
I want for data on each of the conditions to be returned in a text box. If
for example the number of days taken on a trip for condition 1 (below 30
days) happens to be 5, then 5 must be returned in the text box, if the number
of days between 30 and 60 happens to 10, then 10 should be returned in the
text box.


Maybe you can use the section's Format event procedure to do
that:

Select Case Me.[number of days]
Case Is < 30
Me.textbox = Me.[number of days]
Case 30 To 60
Me.textbox = Me.[number of days] - 30
Case Is > 60
Me.textbox = Me.[number of days] - 60
Case Else
MsgBox "'" & Me.[number of days] & "' is invalid"
End Select
 

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

Top