cancel
Showing results for 
Search instead for 
Did you mean: 

Date Ranges

Former Member
0 Kudos

Hello,

I need to date ranges please; 1 to pick up interactions for the last 8 weeks and 1 to pick up interactions for the last 4 months.

Please help!

Many thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I am not sure what you want to do, but if you are looking to select data, my prefrence is to have a start and an end date parameter, rather than a date range parameter then use something like

date({interaction date}) >= {start date parameter} 
and date({interaction date}) < {end date parameter}+1

This will work for either of your examples.

Debi

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for the replies guys and apologies for the vague request! The 2 date ranges are for 2 separate reports, 1 to show interactions for the last 8 weeks and 1 to show interactions for the last 4 months. These reports are run automatically using CRD therfore I'm unable to use date parameters.

Many thanks.

Former Member
0 Kudos

In that case...

Last 4 months...


DateAdd("m", DateDiff("m", #1/1/1900#, CurrentDate) -4, #1/1/1900#)

Last 8 weeks...


DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -8, #1/7/1900#)

Jason

Former Member
0 Kudos

Debi is right... You aren't very specific about what you want to do here.

If you're looking the last 4 months of data to show on the report and then distinguish the records for the last 8 weeks, then do something like this...

In the Select Expert use a formula like this...


{TableName.DateField} &gt;= DateAdd("m", DateDiff("m", #1/1/1900#, CurrentDate) -4, #1/1/1900#)

This will bring in all of the records for the last 8 months.

Then create a formula like this...


IF {TableNmae.DateField} &gt;= DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -8, #1/7/1900#) 
THEN "Last 8 weeks"
ELSE "Last 4 months"

You could then group on this formula if you so choose.

HTH,

Jason