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

Date prompts in Impromptu report 1

Status
Not open for further replies.

mjcotter

Programmer
Jul 9, 2001
66
US
I need to create an Impromptu report. The report will have 3 possible prompts/filters:

Prompt1 = Date 1
Prompt2 = Date 2
Prompt3 = Date 3

The users will only use one of the prompts when they run the report. The other 2 prompts will not be used and should not send any values to the retrieval statement.

Can this be done? I don't see how to do this without the other 2 date prompts sending values.

Thanks!
 
There are several ways to accomplish this:
Make your prompts actual fields in your data tab. Default them to 9999-12-30. Then make your filter:
If (?Prompt1? = 9999-12-30) then (1 = 1) else (DateField = ?Prompt1?) AND If (?Prompt2? = 9999-12-30) then (1 = 1) else (DateField = ?Prompt2?) AND If (?Prompt3? = 9999-12-30) then (1 = 1) else (DateField = ?Prompt3?)

Otherwise, use a single date prompt, and a second prompt to identify which date. Change your filter to:
If (?Prompt1? = Value1) Then (DateField1 = ?DatePrompt?) Else (If((?Prompt1? = Value2) Then (DateField2 = ?DatePrompt?) Else (DateField3 = ?DatePrompt?))

I am what I am based on the decisions I have made.

DoubleD [bigcheeks]
 
mjcotter
consider the solution of having text prompt, date prompt.
for example your prompt1, prompt2, prompt3 are like
Prompt1 = Date 1 (inactive_date)
Prompt2 = Date 2 (active_date)
Prompt3 = Date 3 (effective_date)

you can create 2 prompts with one as text prompt with 3 defined values to choose(inactive, active, effective) and 2nd as date prompt (type in).

Inside your report create a calcuation which results in database date field corresponding to text prompt value.
calc_date = if ?text prompt? = 'inactive' then inactive_date
else if ?text prompt? = 'active' then active_date
else if ?text prompt? = 'effective' then effective_date

use this calc_date = ?date_prompt? in filter clause.

This way your report always filter a data based on date you wanted.

let me know if it is not clear

Regards
 
Thanks guys! Very helpful responses. Seems to have done the trick for me for now. Much appreciated!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top