A Message Board, Guestbook, or Poll hosted for your website.

Ask Golden

Chat
Golden Consulting > Message Board > Formula help for prompt date
 

Thread Tools  | Search This Thread 
Reply
 
Author Comment
 
Pam Petronas
    11/13/08 at 05:08 PM
Reply with quote#1

Hi,
My report has a Startdate prompt which lets you select 1.  'M' - last month or 2. you can enter any  date as a parameter.
based on what is selected in the prompt I need to display the last month.
If the report is run today (based on current date) choosing 'M' it should show Oct date.
if you select to enter a value in the prompt like 9/10/2008 then it should show Aug date.
I have to write a formula to get it. The {?StartDate} is defined as a ''String"

If {?StartDate} = 'M' then
MonthName(month(DateAdd ('M', -1,CurrentDate)),True) & "-" & cstr(DateAdd ('M', -1,CurrentDate),"yyyy")
else
 {?StartDate} (I don't know how to manipulate  {?StartDate} to make it point to last point last month, in this case Aug 2008)


Thanks

 

Previous Thread | Next Thread
Reply

 
Bookmarks
 
Digg Diggdel.icio.us del.icio.usStumbleUpon StumbleUponGoogle Google