Select top 1 fact1,fact2,fact3,total,date from stock_details order by date desc.
Now write this query as sqlcommand and fill the output in datatable.
Then get value for each datatable column and set it to your variable.
i am writing sample code in c#.
foreach(DataRow dr in datatable)
{
int fact1=Convert.ToInt32(dr["fact1"].ToString());
}
in VB
For Each dr As DataRow In datatable
Dim fact1 As Integer = Convert.ToInt32(dr("fact1").ToString())
Next
Updated solution.
If you need only max date column, then try this
Select max(Date) from stock_detail
s
Then
Dim dt as datetime
dt=Convert.ToDateTime(cmd.ExecuteS
calar());