12-14-2006 8:53 AM
Dear All ,
I Have three fields in data base table .
SEQNO - Sequence Number
FDATE - From date
TDATE - to date
now suppose i have one record like
001 13.12.2006 27.12.2006.
In my Program I have given selection screen with parameters for FDATE and TDATE .
user may enter FDATE = 13.12.2006 .
TDATE = 13.12.2006 .
or He may Enter FDATE = 12.12.2006 .
TDATE = 14.12.2006 .
or He may enter FDATE = 17.12.2006 .
TDATE = 18.12.2006 .
for all above cases of selection I need to fetch the record given above .
How should I write the database Query
12-14-2006 8:55 AM
Hi,
Try this...
SELECT *
FROM ztable
INTO TABLE itab
WHERE fdate GE p_fdate
AND tdate LE p_tdate.
Regards
Wenceslaus
12-14-2006 8:56 AM
parameters : p_fdate like ztable-fdate,
p_tdate like ztable-tdate.
select * from ztable into table itab where fdate = p_fdate and
tdate = p_tdate.
Message was edited by:
Chandrasekhar Jagarlamudi
12-14-2006 8:57 AM
select seqno fdate tdate from <TableName>
into table it_tablename
where fdate GE p_fdate
and tdate LE p_tdate.
Regards
- Gopi
12-14-2006 9:00 AM
I Think This condition will fail if I have given third condition .
12-14-2006 9:03 AM
I hope this wouldn't fail.
Since the TDATE param is less than the value for the record
Regards
Wenceslaus
12-14-2006 9:07 AM