krappleby025
Programmer
hi all,
I have a query that retrieves records based on an account number, now, sometimes their is no information and sometimes their is, when their is i need to select the last record, in the database so that i can work with it, here is the query i am using
dim invoices
set invoices = con.execute("SELECT * FROM invoices where accountnumber=" & Accountnumber )
now to get the last record i used
do until invoices.EOF
invoices.movelast
this is not working, what i need to do is, if their are no records retrieved then,
a variable for date for example will be set say 1-1-2001
if a record is retrieved then i need to select the last record, and retrieve the date from it,
the problem i am having is selecting the last record....
any ideas on how i can do that
thanks
I have a query that retrieves records based on an account number, now, sometimes their is no information and sometimes their is, when their is i need to select the last record, in the database so that i can work with it, here is the query i am using
dim invoices
set invoices = con.execute("SELECT * FROM invoices where accountnumber=" & Accountnumber )
now to get the last record i used
do until invoices.EOF
invoices.movelast
this is not working, what i need to do is, if their are no records retrieved then,
a variable for date for example will be set say 1-1-2001
if a record is retrieved then i need to select the last record, and retrieve the date from it,
the problem i am having is selecting the last record....
any ideas on how i can do that
thanks