ON T1A.LOCN = T2.LOCN
AND T1A.PART_BSNo = T2.PART_BSNO
AND T1A.SRCE_TYPE = T2.SRCE_TYPE
WHERE
T2.PART_BSNo BETWEEN :WS-PART-BSNo-LOW
AND :WS-PART-BSNO-HIGH
AND ((T2.LOCN BETWEEN :WS-LOC1-CODE-LOW
AND :WS-LOC1-CODE-HIGH)
OR (T2.LOCN BETWEEN :WS-LOC2-CODE-LOW
AND :WS-LOC2-CODE-HIGH)
OR (T2.LOCN BETWEEN :WS-LOC3-CODE-LOW
AND :WS-LOC3-CODE-HIGH)
OR (T2.LOCN BETWEEN :WS-LOC4-CODE-LOW
AND :WS-LOC4-CODE-HIGH)
OR (T2.LOCN BETWEEN :WS-LOC5-CODE-LOW
AND :WS-LOC5-CODE-HIGH)
OR (T2.LOCN BETWEEN :WS-LOC6-CODE-LOW
AND :WS-LOC6-CODE-HIGH))
ORDER BY T2.LOCN
,T2.PART_BSNO
,T2.SRCE_TYPE
,T1A.EFF_IN_DATE
DESC
Code:
Location BaseNO Type StartDate Capacity Created Time Updated Time
1111B 12345 S 11 DEC 2007 34 23 MAR 2005 22 NOV 2011
1111B 12345 X 13 SEP 2010 11 21 JAN 2009 12 MAY 2010
1111B 66666 Y 10 DEC 2010 41 22 MAR 2009 21 NOV 2011
2222A 11111 T 14 DEC 2009 23 11 FEB 2008 13 AUG 2010
2222A 11111 U 21 DEC 2007 34 23 MAR 2005 22 NOV 2011
2222A 77777 W 11 DEC 2010 41 22 MAR 2009 21 NOV 2011
my new requirement is changed below like this..Then we have to allow ,If customer wants to edit update the any existing column value and inserts the new row except 'Location' and 'BaseNo' and should save it to the tables.LOCN,PART_BSNO,SRCE_TYPE and EFF_IN_DATE is a combined primary key .
How to get the results.Can we need to add any new column in the table?
Code:
Location BaseNO Type StartDate Capacity Created Time Updated Time
1111B 12345 S 11 DEC 2007 34 23 MAR 2005 22 NOV 2011
12345 X 13 SEP 2010 11 21 JAN 2009 12 MAY 2010
66666 Y 10 DEC 2010 41 22 MAR 2009 21 NOV 2011
2222A 11111 T 14 DEC 2009 23 11 FEB 2008 13 AUG 2010
11111 U 21 DEC 2007 34 23 MAR 2005 22 NOV 2011
77777 W 11 DEC 2010 41 22 MAR 2009 21 NOV 2011
Joined: 12 May 2010 Posts: 44 Topics: 12 Location: India
Posted: Fri Aug 12, 2011 5:35 am Post subject:
Hi ;
Requirement is changed little bit.Below will be the new screen in future.We are going to add another column 'YEAR' after the 'BASENO'.The year should always display the Current year + 2 year for every 'Location' column.Each row we can edit and update the column values after the 'YEAR' column values.How to write the query to fetch the values.
Code:
Location BaseNO Year Type StartDate
1111B 12345 2011 S 11 DEC 2007
12345 2012 X 13 SEP 2010
66666 2013 Y 10 DEC 2010
2222A 11111 2011 T 14 DEC 2009
11111 2011 U 21 DEC 2007
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum