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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to filter for date time range

Status
Not open for further replies.

JSeidel

Technical User
Jan 10, 2003
77
0
0
US
I need to be able to filter for "yesterday between 3pm and midnight" plus "today midnight till 6am" how do I write formulas to accomplish this?
 
Try a record selection formula (Report->Edit Selection Formula->Record) containing:

(
{table.datetime} >= cdatetime(year(currentdate-1),month(currentdate-1),day(currentdate-1),15,0,0)
and
{table.datetime} <= cdatetime(year(currentdate-1),month(currentdate-1),day(currentdate-1),23,59,59)
)
and
(
{table.datetime} >= cdatetime(year(currentdate),month(currentdate),day(currentdate),0,0,0)
and
{table.datetime} <= cdatetime(year(currentdate),month(currentdate),day(currentdate),6,0,0)
)

-k
 
Slight change to the formula :
(
{table.datetime} >= cdatetime(year(currentdate-1),month(currentdate-1),day(currentdate-1),15,0,0)
and
{table.datetime} <= cdatetime(year(currentdate-1),month(currentdate-1),day(currentdate-1),23,59,59)
)
OR
(
{table.datetime} >= cdatetime(year(currentdate),month(currentdate),day(currentdate),0,0,0)
and
{table.datetime} <= cdatetime(year(currentdate),month(currentdate),day(currentdate),6,0,0)
)


Reebo
Scotland (Sunny with a Smile)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top