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: 

comparing period and date

Former Member
0 Kudos

hi,

Are period and date , directly comparable.

that is...i have

seloption:SO_PERIOD: 02.2005 to 03.2006

and Ztable like this...

col1 col2

xxx 01.01.2005

yyy 01.02.2005

yyy 02.01.2005

yyy 01.03.2006

will the statement..

select col1 from ztable where col2 in so_period.....return all values

pls help.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Please do not multiple threads for the same question. Please close this thread..

Thanks,

Naren

5 REPLIES 5

Former Member
0 Kudos

Hi,

Please do not multiple threads for the same question. Please close this thread..

Thanks,

Naren

0 Kudos

thanks.....i closed previous thread.....and let this be active

pls give answer...

former_member191977
Contributor
0 Kudos

Hi,

I don't think the direct select will work.

if your period 02.2005 is the month and the year you can modify your period values to be from the starting of the 2nd month and similarly the To period and then do a select it will work.

Award points if it helps.

Thanks.

Former Member
0 Kudos

Hi Saravanan,

No, it wont return any values as COL2 and SO_PERIOD are of different types.

But you can achieve this by collecting the start date and end date of SO_PERIOD into dates and use this range to select against COL2.

Check this thread which will have same requirement as you needed.

Thanks,

Vinay

Former Member
0 Kudos

Hi,

Create a range and assign the values to it like,

ranges: r_period for glpca-poper.

r_period-sign = 'I'.

r_period-option = 'BT'.

r_period-low = so_period-low+0(2).

r_period-high = so_period-high+0(2).

append r_period.

Now change the select query as:

select col1 from ztable where col2 in r_period.

Regards

Subramanian