How to get Last Number of Database row

Posts   
 
    
Posts: 97
Joined: 29-Apr-2009
# Posted on: 30-Jun-2009 12:57:32   

Hello All,

i have table with two field,

JobDetailID (int) AutoIncreament JobTitle varchar(200)

i need to find the last number of jobdetailID. how can i achieve in self servicing?

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 30-Jun-2009 21:29:45   

Do you mean you want to find the MAX value currently existing in the table ? This can be accomplished using a aggregate scalar query

Matt

Posts: 97
Joined: 29-Apr-2009
# Posted on: 01-Jul-2009 08:10:44   

MTrinder wrote:

Do you mean you want to find the MAX value currently existing in the table ? This can be accomplished using a aggregate scalar query

Matt

Thanks MTrinder

I have solved like this


 string StrJob = ClaJobClass.GetScalar(JobdetailsFieldIndex.JobDetailId, AggregateFunction.Max).ToString();