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

select query for fields in selection screen

Former Member
0 Likes
977

SELECT * FROM hrus_d2

INTO TABLE ta_list

WHERE us_name IN subs_obj

and begdat in date_ran.

  • and enddat in date_ran

How can I rewrite the above query for high and low ranges of date_ran field in condition? It doesn't allow in operator with date_ran-low.Can u please help me out

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
845

Hi

rahul

SELECT *

FROM hrus_d2

INTO TABLE ta_list

WHERE us_name IN subs_obj

and begdat = date_ran-low

and enddat = date_ran -high.

u can write like this or i amnot getting why u r expliciting this date u can give directly as

SELECT *

FROM hrus_d2

INTO TABLE ta_list

WHERE us_name IN subs_obj

date in date_ran.

plzz reward if i am usefull to u in any way.. plzz dont forget to reward

7 REPLIES 7
Read only

Former Member
0 Likes
845

Hi,

if not date_ran is initial.

SELECT *

FROM hrus_d2

INTO TABLE ta_list

WHERE us_name IN subs_obj

and begdat = date_ran-low

and enddat = date_ran -high.

endif.

Edited by: Arunachalam, Selvapandian on Jan 3, 2008 3:33 PM

Read only

0 Likes
845

Hi,

I don't know if I got you right, but I would suggest:

SELECT * FROM hrus_d2 INTO TABLE ta_list

WHERE us_name IN subs_obj

AND ( begdat GE date_ran-low AND begdat LE date_ran-high )

AND ( enddat GE date_ran-low AND enddat LE date_ran-high ).

However, this code will only work for NO EXTENSION select options type.

Best regards,

Valter Oliveira.

Read only

Former Member
0 Likes
845

When you want use ONLY high & low in your query then you must use EQ operator. like

begdat EQ date_ran-low

"OR

begdat EQ date_ran-high

Read only

Former Member
0 Likes
845

Hi,

SELECT * FROM hrus_d2

INTO TABLE ta_list

WHERE us_name IN subs_obj

and begdat = date_ran-high.

Read only

Former Member
0 Likes
845

Hi U can set those value independantly...

Like..

date_ran-high = 'value1'.

date_ran-low = 'value2'.

append date_ran.

Read only

Former Member
0 Likes
846

Hi

rahul

SELECT *

FROM hrus_d2

INTO TABLE ta_list

WHERE us_name IN subs_obj

and begdat = date_ran-low

and enddat = date_ran -high.

u can write like this or i amnot getting why u r expliciting this date u can give directly as

SELECT *

FROM hrus_d2

INTO TABLE ta_list

WHERE us_name IN subs_obj

date in date_ran.

plzz reward if i am usefull to u in any way.. plzz dont forget to reward

Read only

Former Member
0 Likes
845

Thanks