Re: Reports: Multiple date formats on paramform?

From: Hakan <heren_at_home.com>
Date: 2000/07/20
Message-ID: <39764409.BBC5C890_at_home.com>#1/1


hi,

there are more than one way. but you need to define the two fields as "character".
not date. Also you need to add two "date" placeholder columns in the report.
I assume you can identify the user(us or uk user) Then you can verify dates in validation triggers. After verifying them, convert to date
and place in those dummy date fields.
Steps are in the following:
1) Change :P_RepStartDate and :P_RepEndDate to character with width 10 2) The validation trigger looks like (for each parameter) :P_RepStartDate
 if(user_type = 'UK') THEN
  :CP_newstartdate := TO_DATE(:P_RepStartDate, 'DD/MM/YYYY');  else -- us user
  :CP_newstartdate := TO_DATE(:P_RepStartDate, 'MM/DD/YYYY');  end if;
:P_RepEndDate validation trigger
 if(user_type = 'UK') THEN
  :CP_newenddate := TO_DATE(:P_RepEndDate, 'DD/MM/YYYY');  else -- us user
  :CP_newenddate := TO_DATE(:P_RepEndDate, 'MM/DD/YYYY'); end if;
3) change the query:
Select datefield1, datefield2
from
table1
where
datefield1 >= :CP_newstartdate
and datefield2 < :CP_newenddate

need further help, send me the report with underlying structures.

Hakan

jwilks66_at_my-deja.com wrote:
>
> On a report's parameter form that contains two date fields, what is the
> best method to enable different users to enter different date formats?
> Ie: we have customer in the US and UK. I want US users to enter dates
> in 07/17/2000 format and UK users to enter in 17/07/2000, all in the
> same report (don't want to develop the same report twice with this one
> difference).
>
> You can accept various date as CHAR in parameter and take care of
> validation in the trigger, but how and where would you convert the
> string back to a date. For instance,
>
> My query:
> Select datefield1, datefield2
> from
> table1
> where
> datefield1 >= :P_RepStartDate
> and datefield2 < :P_RepEndDate
>
> So, when running the report for month of July 2000, after the user
> enters the char date in the param form, the two date parameters will be
> in one of two formats: '07/01/2000' & '08/01/2000' OR '01/07/2000' &
> '01/08/2000'. How would I get this to work?
>
> TIA,
> Jason
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
  Received on Thu Jul 20 2000 - 00:00:00 CEST

Original text of this message