Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Data Fecthing

Former Member
0 Kudos

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

6 REPLIES 6

Former Member
0 Kudos

Hi,

Try this...

SELECT *

FROM ztable

INTO TABLE itab

WHERE fdate GE p_fdate

AND tdate LE p_tdate.

Regards

Wenceslaus

Former Member
0 Kudos

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

gopi_narendra
Active Contributor
0 Kudos

select seqno fdate tdate from <TableName>

into table it_tablename

where fdate GE p_fdate

and tdate LE p_tdate.

Regards

- Gopi

0 Kudos

I Think This condition will fail if I have given third condition .

0 Kudos

I hope this wouldn't fail.

Since the TDATE param is less than the value for the record

Regards

Wenceslaus

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

select * from db into table itab

where tdate GT p_tdate.