Application Development and Automation 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: 
Read only

Data Fecthing

Former Member
0 Likes
646

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
Read only

Former Member
0 Likes
591

Hi,

Try this...

SELECT *

FROM ztable

INTO TABLE itab

WHERE fdate GE p_fdate

AND tdate LE p_tdate.

Regards

Wenceslaus

Read only

Former Member
0 Likes
591

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

Read only

gopi_narendra
Active Contributor
0 Likes
591

select seqno fdate tdate from <TableName>

into table it_tablename

where fdate GE p_fdate

and tdate LE p_tdate.

Regards

- Gopi

Read only

0 Likes
591

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

Read only

0 Likes
591

I hope this wouldn't fail.

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

Regards

Wenceslaus

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
591

Hi,

select * from db into table itab

where tdate GT p_tdate.