This SQL statement should select the maximum number in the Auto Numbering column ' JOB_no' in my SQL database.
VB Code:
strSQL = "SELECT MAX(JOB_no)" strSQL = strSQL & " FROM JOBS" strSQL = strSQL & " WHERE myusername = '" & Nowuser & " '" Call SQL_SELECTconnection()
How do I actually 'use' the result in VB.net 2005 ?
EG MSGBOX (the result of my query?)
I tried - MsgBox(mydataset.Tables(0).Rows(0)("job_No"))
(Which works for a normal select statement), but errors when using 'MAX' - stating job_no is not a valid column of table 'table'.




Reply With Quote