Simple question....I think

I’m trying to set up a variable that gives dates that are <= 30 days from the current date. But I get an error when I try it. Can someone help me with this? I can set up something that goes current date - 30, but not <=


bull76 (BOB member since 2010-04-08)

Hi,

Create a variable which shows the difference between given date and current date and use an If then Else

=If(Daysbetween([Given Date];[Currentdate])<=30) Then "" Else ""

Hope that helps


M H Mohammed :us: (BOB member since 2010-06-16)

A small suggestion - Hope [Given Date] is in Date format, if not you need to convert it.


aniketp :uk: (BOB member since 2007-10-05)

Are you trying to dynamically derive all the dates that falls between the Current date and Current Date - 30 days?

Or do you have a date object against which you want to validate this?


jprasanthram :switzerland: (BOB member since 2010-12-10)

What error are you getting exactly??


tarunteotia :india: (BOB member since 2011-02-16)

Thanks for the help. After speaking with the requestor, she wants me to take the end date (prompted) and add 45 days to that and display that date in the report

Ex.

If I enter the prompted dates ‘begin date’ 01/01/2011 and ‘end date’ 03/31/2011

I want to display a date 45 days from the 3/31/2011 date entered.

Is that possible?


bull76 (BOB member since 2010-04-08)

Look at the UserResponse() and RelativeDate Funtions. You will also have to turn the string returned by UserResponse into a “proper” date.


Mak 1 :uk: (BOB member since 2005-01-06)

Hi,

This would be the date after adding 45 days to the date entered

=RelativeDate(ToDate(UserResponse("Enter Date:");"");45)

M H Mohammed :us: (BOB member since 2010-06-16)

Or you can try this, sometimes when you select from Calendar dates, you get timestamo too…

=RelativeDate(ToDate(Trim(If(Pos(UserResponse("End Date");" ") = 0;Substr(UserResponse("End Date");1;10);Substr(UserResponse("End Date");1;Pos(UserResponse("End Date");" ") )));"MM/dd/yyyy");45)

aniketp :uk: (BOB member since 2007-10-05)