Actually, I have a list of dates in a SQL table, in which there are some figures next to each of them I want to compare dates with a certain date in the table. However, in my table, my dates are stored as Vaishar (50) (and should be). Obviously I can convert date to date in the table but I do not know. Does anyone know how? My current code can be seen below
if chosen = "today" then datestop = today. Add (-1) Dim ObjectMDD in the form of new SQL Commands ("from select COUNT (*) data where (date & gt;" & DateStop & amp; "," ObjConn ") MessageBox.Show (" Select COUNT (* ) Statistics where (date & gt; "& DateStop.Date & amp;;)" ObjDataReader = objCmd.ExecuteReader test = ObjDataReader (0) MessageBox.Show thanks in advance. / P>
Edit: I get an error of missing data, when I know that there are definitely dates in my table before and after the day I am trying .
I think what you are missing objCmd .read () Or objCmd.ExecuteScalar () instead of objCmd.ExecuteReader () . ObjDataReader = objCmd.ExecuteReader ObjDataReader.Read Can use) Test = ObjDataReader (0) MessageBox.Show (test) or ... test = objCmd.ExecuteScalar () MessageBox .how (test) (You may still need to insert or perform functions as others have suggested.)
Comments
Post a Comment