i need to get record based on maximum created date any body help me
date in mysql database structure is varchar. date is 150921141206
any body help me
Jump to PostJust use a WHERE clause comparing to the MAX date, or ORDER BY DESC.
Just use a WHERE clause comparing to the MAX date, or ORDER BY DESC.
very thanks
here is a sample code:
Private Sub mainform_Load(sender As Object, e As EventArgs) Handles MyBase.Load
cmd.Connection = conn
cmd.CommandText = "SELECT MAX(ColumnName) FROM [db_Name].[dbo].[tbl_Name]"
conn.Open()
dr = cmd.ExecuteReader()
Do While dr.Read()
'max value showing on the textbox
x.Text = x.Text & dr.GetValue(0) & vbTab
Loop
dr.Close()
conn.Close()
End Sub
btw, if this already answered post, kindly mark it as solved.
use where clause
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.