Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

current date check

Status
Not open for further replies.

howhowhow

IS-IT--Management
May 2, 2003
4
US
i'm trying to print out a report from a db that has the most recent DATE!

what it returns now is all the dates but i just want the lastest one, i.e. it show's stuff on 4/25 and 4/24, etc..
and all i want is the stuff on 4/25..

i was trying
to do something like:

if date({SFTI:_Activity_Log.Create Date}) = {@date}
then {SFTI:_Activity_Log.Create Date}

@date is just the most recent entry and
({SFTI:_Activity_Log.Create Date}) is what is being
pulled out of the db..

i get a error saying Formula can not be used because
it must be evaluated later, and i tried the executeafter
function as well.

is there a easlier way to just check for the most current
date and print whatever is on that date or is this the way to do it?

thanks
 
You can either use a Top N report to pull only the row(s) with the maximum date, or you can use the record selection formula to limit it to a specific date.

The approach you took sounded close, try the following in the record selection formula:

{table.date} = currentdate

This will get you rows from todays date.

-k
 
thanks for the reply and i get what your said
but i think i'm doing something wrong..

everytime i use the "select expert" to do the
formula it keeps coming up with this error
"Formula can not be used because
it must be evaluated later"

am i using it wrong?

thanks again
 
when i put this in the formula field for date it works
but i need this check to happen for the entire group,
when i do this in the select for the group i keep getting
the "Formula can not be used because it must be evaluated later"

if date({Log.Create Date}) = Maximum ({Log.Create Date}, {Log.Customer})
then {Log.Create Date}

am i putting this in the wrong place?

thanks in advance

-wayne
 
I couldn't recreate your error above using the group select--are you sure you were in the group select editor and not the record select editor? Because your formula would result in that message in the record select. But your syntax for the group select should be:

{Log.Create Date}) = Maximum ({Log.Create Date}, {Log.Customer})

In your last example, you used "date" before the log field in the first part of the formula, but not in the last. Is the log field a date field?

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top