06-25-2010 8:53 AM
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
06-25-2010 9:20 AM
Hello
Try like this:
data: p_idate like imrg-idate.
concatenate '____' var_month '__' into p_idate.
select * from IMRG where IDATE like p_idate
06-25-2010 9:15 AM
use this code
data itab type standard table of imrg.
select * from IMRG into table itab where IDATE GT '19950601' and IDATE LT '19950630'.
06-25-2010 9:20 AM
Hello
Try like this:
data: p_idate like imrg-idate.
concatenate '____' var_month '__' into p_idate.
select * from IMRG where IDATE like p_idate