Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

compare only month part of a date field in the where clause

hi friends i want to select all the records in the table IMRG where the month part in date field IDATE is a particular month.This month is stored in a variable.and is not constant.

like :

select * from IMRG where IDATE +4(2) = var_month

but in above case there is error "field IDATE +4(2) is sunknown "

here var_month stores the month for wich i have to select records from the table.

ihave tried :

select * from IMRG where IDATE like '____var_month__'

but it is not working and giving runtym error as expected.my problem is that the month is stored in a var.

Plz help .

Edited by: achalmehra on Jun 25, 2010 9:54 AM

Former Member
Former Member replied

Hello

Try like this:

data: p_idate like imrg-idate.
concatenate '____' var_month '__' into p_idate.
select * from IMRG where IDATE like p_idate

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question