I need to get the values for 3 week average ,I will be passing the cycle date value to the query from the cobol program ..So i harded coded the cycle date as '2012-01-31' in the db2 query,to verify if this query works.. but its not fetching any records,though records are present , can any one please help on this :
SELECT Stu_name,Stu_join_Date
FROM Student_tbl
WHERE Stu_join_Date BETWEEN
DATE (DATE(2012-01-31) - 24 DAYS) AND
DATE (DATE(2012-01-31) - 18 DAYS) WITH UR;
FROM Student_tbl
WHERE Stu_join_Date BETWEEN
DATE (DATE(2012-01-31) - 24 DAYS) AND
DATE (DATE(2012-01-31) - 18 DAYS) WITH UR;
actual query in the pgm will be like :
SELECT Stu_name,Stu_join_Date
FROM Student_tbl
WHERE Stu_join_Date BETWEEN
DATE (DATE(:ws-cycledt) - 24 DAYS) AND
DATE (DATE(:ws-cycledt) - 18 DAYS) WITH UR;
FROM Student_tbl
WHERE Stu_join_Date BETWEEN
DATE (DATE(:ws-cycledt) - 24 DAYS) AND
DATE (DATE(:ws-cycledt) - 18 DAYS) WITH UR;