Hi Forum, i have a problem, hope somebody can give me ideas. I'm
developing with windows forms and vb.net, and oracle as a database. At
this moment i have a table called amortizaciones, this table has a
field called id_pasivo, which is foreign key to another table called
pasivo, a consecutive field called no_cupon and a third field called
date. So when i make a query (i.e select * from amortizaciones where
id_pasivo = 522 order by no_cupon), it returs something like this:
id_pasivo no_cupon date
----------------------------------------------
522 1 03/12/2004
522 2 03/01/2005
522 3 03/02/2005
522 4 06/03/2005
522 5 05/04/2005
522 6 06/05/2005
522 7 07/06/2005
522 8 08/07/2005
522 9 08/08/2005
522 10 08/09/2005
522 11 09/10/2005
522 12 09/11/2005
522 13 30/11/2005
but when i open a form, insert a value, i have push a button and then i
have to read this query and compare the date, for example i capture a
value on 11/11/2005, it means that the date is between the 9/11/2005
and 30/11/2005, or between the no_cupon value 12 and 13. Well
firstable, how can i compare the next value in the while
datareader.read?? i want to compare the field date of the current
record and the same field of the next record against the date entered
by user (11/11/2005), so if thr date entered is between then insert a
new record that replaces the
current and the next record or records needs to update and increment
the value of the field no_cupon. So it will be like:
id_pasivo no_cupon date
----------------------------------------------
522 1 03/12/2004
522 2 03/01/2005
522 3 03/02/2005
522 4 06/03/2005
522 5 05/04/2005
522 6 06/05/2005
522 7 07/06/2005
522 8 08/07/2005
522 9 08/08/2005
522 10 08/09/2005
522 11 09/10/2005
522 12 09/11/2005
522 13 11/11/2005
522 14 30/11/2005
The date entered was inserted after the next lower date and before the
next bigger date, with the consecutive no_cupon, and the rest of them
was incremented on this field, thats what i need to do.
Somebody can help me? i was trying to do with an arraylist, a
datatable, but not successfull
Thanks in advanced