Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get last record in db thanks

Status
Not open for further replies.

melnet

Programmer
Jul 8, 2003
77
HK
hi

i wanna get the last record.
i tried to code:
rs.MoveLast
pid=rs("productID")

get a error...:can't support to get the record from last(sth like that)

any method to solve?

and

2.33333333....=7/3
i dont want to get 2.333333...
i wanna get 3.

i just coded:
a=CInt(ttlCount/3)
b= ttlCount mod 3
c=a+b

~.~;

thanks
 
Does the last record have the highest number PID? If so, do it with your SQL.
Code:
strSql="SELECT MAX(PID) as theLastRecord FROM myTable"
set rs = conn.execute(strSql)
pid = rs("theLastRecord")

 
and the maths

Code:
response.write RoundUp(7,3)


function RoundUp(Dividend,Divisor)
if Dividend / Divisor - Dividend \ Divisor =< 0.5 then
RoundUp = round((Dividend / Divisor) + 0.5)
else
RoundUp = round(Dividend / Divisor)
end if
end function



Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top